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?
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).
You can contact us by phone, email or our social media accounts — we are here to assist you.