Using the utility ExtractXFAData
you can export XFA data from
a PDF document and use it in XPath based tests as described in section
3.37: “XFA Data”.
:: :: Extract XFA data of a PDF document as XML :: @echo off setlocal set CLASSPATH=./lib/aspectj-1.8.7/*;%CLASSPATH% set CLASSPATH=./lib/bouncycastle-jdk15on-153/*;%CLASSPATH% set CLASSPATH=./lib/commons-logging-1.2/*;%CLASSPATH% set CLASSPATH=./lib/pdfbox-2.0.0/*;%CLASSPATH% set CLASSPATH=./lib/pdfunit-2016.05/*;%CLASSPATH% set TOOL=com.pdfunit.tools.ExtractXFAData set OUT_DIR=./tmp set IN_FILE=xfa-enabled.pdf set PASSWD= java %TOOL% %IN_FILE% %OUT_DIR% %PASSWD% endlocal
The input file for the script is xfa-enabled.pdf
, a
sample document from iText.