Print ZUGFeRD compliant PDF invoices / PDF Printer
This chapter of our manual shows you how to create ZUGFeRD-compliant PDF invoices (Factur-X) using our PDF printer.
The core application is our PDF printer, as it provides the creation of PDF/A-3b files as the foundation for ZUGFeRD-compliant PDF documents. This PDF specification is the basis for attaching additional files—XML files in the case of ZUGFeRD—to PDF documents.
7-PDF Printer and 7-PDF Attach Extract & Remove
The process of attaching so-called XML invoices (eInvoices) to PDF files works as follows: 7-PDF Printer first prints the required PDF/A-3b invoice document in PDF format 1.7, and with 7-PDF Attach Extract and Remove (PDFAttachExtractAndRemoveFiles.exe)
, our software for managing PDF attachments or file appendices, we attach the desired XML invoice file to the PDF invoice. 7-PDF Attach Extract and Remove can be used classically via a user interface (GUI) by an operator, but also as a console application (CLI mode) for automation. This is precisely the capability we will make use of. Using the VBScript framework of the 7-PDF Printer, we will write a small macro that automatically executes PDFAttachExtractAndRemoveFiles.exe
via console command and attaches the e-invoice XML directly when printing the ZUGFeRD PDF document. The macro and all other required files can be found in the download table at the bottom of this page.
7-PDF Invoice Extractor – AI-Powered Analysis Service
With our new AI-powered service 7-PDF Invoice Extractor, you can convert your standard PDF invoices—created in Word, Excel, ERP legacy systems, or other systems/applications (DMS)—into valid ZUGFeRD e-invoices (DIN EN 16931 compliant) without complex third-party software. The solution is fully integrated into 7-PDF Attach Extract and Remove starting from version 2.0. The function “PDF Invoice to PDF ZUGFeRD” is available under the corresponding tab within 7-PDF Attach Extract and Remove. This part of the programming is also placed inside the VBScript macro. This means we can generate AI-powered ZUGFeRD PDF e-invoices fully automatically from (almost) any invoicing application! The necessary steps for this outlined solution are illustrated for you in detail below.
The following screenshot is for informational purposes and shows the possible parameters for controlling the PDF Attach Tool “7-PDF Attach Extract and Remove” in CLI mode via the console application PDFAttachExtractAndRemoveFiles.exe
:
Run 7-PDF Attach Extract and Remove in the Windows 11 command prompt as a console application. Use the parameter /?
to get help for the program
Using "7-PDF Attach Extract and Remove" with 7-PDF Printer
To now fully automatically print ZUGFeRD-compliant PDF invoices with our PDF printer 7-PDF Printer, the application PDFAttachExtractAndRemoveFiles.exe
must first be installed. This installation is automatically performed by our macro ZUGFeRD.vbs
. As a plug-in, the application is later executed "hidden" when printing the invoice data with 7-PDF Printer in order to attach the invoice XML file in a compliant manner.
Automatically create ZUGFeRD PDF with 7-PDF Printer
If PDFAttachExtractAndRemoveFiles.exe
is available through installation as a plug-in application (this happens automatically), we still need the macro ZUGFeRD.vbs
required for fully automatic creation of ZUGFeRD-compliant PDF files with 7-PDF Printer.
You will find a ZIP archive at the bottom of the download table named PlugIn_ZUGFeRD_7PDF_Printer.zip
, which contains this free-to-use macro. As is customary with our PDF printer, the macro ZUGFeRD.vbs
must be placed in the Macros folder. So please copy the VBS file into this directory.
ZUGFeRD.vbs macro must be placed in the Macros folder of the 7-PDF Printer. The VB script is provided free of charge by us.
The macro automatically calls PDFAttachExtractAndRemoveFiles.exe
after printing the required PDF/A-3b document and fully automatically attaches the matching ZUGFeRD-compliant XML invoice file to the printed PDF. The AI-powered service 7-PDF Invoice Extractor provides the required valid invoice XML.
The really important line here is the marked line (red arrow) in the VBScript macro. This is where PDFAttachExtractAndRemoveFiles.exe
is called by the 7-PDF Printer in Hidden Mode with all parameters necessary for attaching the XML file. The path may need to be adjusted for older Windows versions.
Simulated invoice printing
As a simulation example of invoice printing, we will simply use the following sample invoice (available for download below). For this test or example, printing is done from MS Word. We simply want to test whether the creation of PDF ZUGFeRD documents works technically as expected.
After that, you can use your own Word or Excel invoice template and continue testing our 7-PDF Invoice Extractor in detail. Or perhaps send an invoice print job from your legacy ERP system—which may not yet support the ZUGFeRD PDF format—to our PDF printer and 7-PDF Invoice Extractor?
Sample invoice with invoice number marked in red.
Note: The sample invoice is also available for download below.
Start simulation
Let’s recap: PDFAttachExtractAndRemoveFiles.exe
is installed in its standard path, and ZUGFeRD.vbs
is placed in the Macros
directory of the 7-PDF Printer. Now let’s run the simulation by printing our sample invoice from Word using the 7-PDF Printer.
Sample invoice with invoice number marked in red.
The print dialog of our PDF printer appears. After selecting the location where the PDF/A-3b file should be saved, click the "Save" button.
Tip: After submitting the print job, it's best to minimize MS Word and any other windows, if applicable, so that you can actually see all of the PDF printer's message dialogs the first time you run it. If 7-PDF Printer needs to install additional programs, such as 7-PDF Attach Extract and Remove, you may be prompted to submit the print job again. This only happens during the initial setup and is completely normal. You must also confirm the one-time notification that invoice data is being transferred to our validation and generation services. The data is deleted from our server immediately after processing and transmitted using SSL security.
Print dialog of the 7-PDF Printer appears
The Result
The result is a PDF/A-3b invoice document with an attached ZUGFeRD-compliant XML file, as clearly shown by Adobe Acrobat Reader.
ZUGFeRD-compliant PDF invoice in Acrobat Reader
Our Solution: The 7-PDF Validator

But is the result really valid? Does the ZUGFeRD XML (factur-x.xml) really contain all relevant invoice data? This is where our tool comes in: it enables the validation of e-invoices in the XRechnung and PDF ZUGFeRD format. Your incoming and outgoing invoices are checked according to the DIN EN 16931 schema. Additionally, the validator checks whether the e-invoice document complies with VAT regulations and can be legally accepted by you or your invoice recipient.
Especially important:
- The PDF document should be compliant with the PDF/A-3 standard (long-term archiving).
- The XML of the e-invoice must be properly embedded. (Note: Our tool 7-PDF Attach Extract and Remove embeds XML e-invoices correctly in a PDF/A-3 document.)
Automatic and manual validation
Our validator checks all these requirements fully automatically in CLI/console mode and provides appropriate feedback, which you or our PDF printer can respond to. For easy integration, we have already included the validator in our macro ZUGFeRD.vbs
. If necessary, it is automatically installed and configured on your system. Alternatively, you can also validate e-invoices manually via the user interface.
Setup and use of our online services
During setup, you will be asked whether you agree to generation and validation via our online services. For this example, you can confirm with "Yes".
Important note for productive use:
If you plan to use the Invoice Extractor and Validator productively, please note that your invoice data will be transmitted to our two online services for XML generation/validation. These are hosted on a server in Germany (STRATO).
🔒 Security and data protection:
- Your data will only be stored, processed, and validated for the duration of the generation and validation process.
- Afterward, it will be automatically deleted.
- Data transmission is exclusively SSL-encrypted.
The following screenshot shows the VBScript code line that triggers the validation process.
Important line in the VBScript macro. Here, SevenPDFValidator.exe
is executed by the 7-PDF Printer in Hidden Mode with all necessary parameters for validating the e-invoice.
Automatic feedback in the PDF printer
If your e-invoice is not valid, our PDF printer will display a corresponding message. This happens because the validator's exit code was not 0 (OK), but 1 (Error).
📌 More information & download
Are you interested in our 7-PDF E-Invoice Validator? You can find more information on the product page:
👉 Go to the 7-PDF E-Invoice Validator!
If you are interested in using our validator or want more information about our tool, you can access the product page of our 7-PDF E-Invoice Validator via this link!
Print dialog of the 7-PDF Printer appears
Pay attention to printer driver
7-PDF Printer can be installed as a central PDF network printer in addition to a classic installation as a desktop application or a local PDF printer installation (default). The installation-parameter for this is /SHARE
.
After installation as a PDF network printer, it may be necessary to change the printer driver selected after installation to 7-PDF Printer, as shown in the screenshot below, to create ZUGFeRD PDF documents. For higher compatibility a Postscript driver of the operating system is used if necessary. In the case of ZUGFeRD, however, we need direct access to print data, and this is only possible if the PDF network printer instance (in the screenshot "PDF-EXP-Prt") is operated under the printer driver "7-PDF Printer". So you should have a look here, that the printer instance also uses the correct printer driver.
For ZUGFeRD the correct driver 7-PDF Printer must be used!
Note: Starting with Windows 10, you must temporarily disable printer sharing for the duration of the driver change, otherwise you will receive an operating system error message.
Conclusion
Printing e-invoices is really easy thanks to our software components: 7-PDF Printer as a PDF/A3 provider, 7-PDF Attach Extract and Remove as an interface to our AI-supported service 7-PDF Invoice Extractor, and our 7-PDF E-Invoice Validator for validation. Even with Word, Excel, or existing invoicing programs and ERP solutions that may not yet be "ready" for e-invoicing, the "e-invoicing requirement" can be implemented.
Supported ZUGFeRD versions and Factur-X 1.0
PDFAttachExtractAndRemoveFiles.exe
supports the attachment of already ZUGFeRD compliant XML documents of the EU standard of EN 16931. This includes besides the ZUGFeRD versions 1.0, 2.0, 2.1 also Factur-X 1.0 (France). The abbreviation ZUGFeRD stands for the specification "Central User Guide of the Forum Electronic Invoice Germany" and is a format for the exchange of electronic invoice documents.
Attach other file types to PDF/A-3b
In the desktop mode of our 7-PDF Attach Extract and Remove Tool Version 1.0.0.174 (PDFAttachExtractAndRemoveFiles.exe
) you can attach not only XML documents to PDF/A-3b compliant documents, but also all other valid file types such as *.pdf, *.docx, *.xlsx, *.pptx, *.rtf, etc. The tool supports the attachment of these files in normal GUI mode but also in CLI mode, i.e. via console, and can be very useful for automating your e-invoicing processes!
Downloads
Attachment | Size |
---|---|
PlugIn_ZUGFeRD_7PDF_Printer.zip (ZUGFeRD VBS Macro for 7-PDF Printer) | 11.10 KB |
7-PDF Attach Extract and Remove (ZUGFeRD) Tool | 10.05 MB |
7-PDF E-Invoice Validator | 11.40 MB |
invoiceexample.doc.zip | 24.71 KB |