Knowledgebase

Back to Articles List

How do I use the PDF-to-text functions of the PDF-XChange Pro SDK to extract text from the fields of a flat PDF form?

Question:

How do I use the PDF-to-Text functions of the PDF-XChange PRO SDK to extract text from the fields of a flattened PDF form?

Answer:

The text extraction functions of the PDF-XChange PRO SDK cannot be used for this purpose. This is because the extraction algorithm cannot recognise forms or their data after the process of flattening occurs. AcroForm field data can be extracted only when the PDF is in active AcroForm format. When PDF forms are flattened all references to fields and their data is lost.

However, the Export PDF form to FDF function of the Viewer SDK can be used to export PDF form fields before they are flattened. Additionally, the Viewer SDK can export form fields to XML-based XFDF files, which are better for parsing. Another option is to use JavaScript in the Viewer SDK to retain the field values. See here for further information (page 288).

 

Was this article helpful?
Yes No Somewhat