9.15.  Extract ZUGFeRD Data

The invisible embedded ZUGFeRD data are relevant for accounting, and they should have the same value as the visible data.

At least once in the development process for PDF producing programs, the ZUGFeRD data of a document should be made visible and checked. This can be done with the provided extraction utility ExtractZugferdData.

Program Start

The program is started using the following script:

:: Extract ZUGFeRD data from a PDF document.

@echo off
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/pdfunit-2016.05/*;%CLASSPATH%
set CLASSPATH=./lib/pdfbox-2.0.0/*;%CLASSPATH%

set TOOL=com.pdfunit.tools.ExtractZugferdData
set OUT_DIR=./tmp
set IN_FILE=./zugferd10/ZUGFeRD_1p0_BASIC_Einfach.pdf

java  %TOOL%  %IN_FILE%  %OUT_DIR%  %PASSWD%

The name of the extracted file derives from the name of the source file. In this case the file _zugferd_ZUGFeRD_1p0_BASIC_Einfach.out.xml will be created. Its content is the embedded ZUGFeRD file of the PDF but without comments.