Page 1 of 1

PDF-Tools SDK equivalent of FlattenAnnots

Posted: Mon Aug 27, 2012 12:56 pm
by wings software
Hi,

Is there a PDF-Tools SDK equivalent for the JS flattenPages() function or the Viewer SDK FlattenAnnots function? Actually, my goal is to extract the text from form fields using the Tools SDK...

TIA,

Jan

Re: PDF-Tools SDK equivalent of FlattenAnnots

Posted: Mon Aug 27, 2012 8:19 pm
by Nico - Tracker Supp
Hi wings software,

Thank you for your post.
You can use the JavaScript functions from PDF-Tools with function: PXC_AddJavaScript to use your JavaScript functions to get the fields values.
Another way would be to export the data to a FDF file.
This has been covered previously in another forum thread here:
https://forum.pdf-xchange.com/ ... ext#p21849
Thanks.

Re: PDF-Tools SDK equivalent of FlattenAnnots

Posted: Tue Aug 28, 2012 8:16 am
by wings software
Nico,
Nico - Tracker Supp wrote:You can use the JavaScript functions from PDF-Tools with function: PXC_AddJavaScript to use your JavaScript functions to get the fields values.
Reading the documentation I was under the impression that PXC_AddJavaScript would add some JS code that is executed within the viewer. I tried to add "this.flattenPages" via PXC_AddJavaScript and it seemed to work at first, but when I opened the file in Acrobat Reader it still showed the form fields. So obviously, the java script is only run in the viewer, and the flattened text is not in the PDF file.

Any alternative not involving the PDF Viewer?

Thanks,

Jan

Re: PDF-Tools SDK equivalent of FlattenAnnots

Posted: Tue Aug 28, 2012 4:29 pm
by Nico - Tracker Supp
Hi wings software,

Yes, that's right. I'm afraid there is not other way to do it but using the Viewer JavaScript functions.
Next version of the Viewer will allow to access the form objects directly.
Thanks.

Sincerely,