i-effect Manual
German English
German English

Creating ZUGFeRD files: file names, parameters and PDF/A (from i-effect 3.1.19)

From i-effect 3.1.19, the outgoing ZUGFeRD mappings (ZUGFERD_<version>_COMFORT_OUT, ZUGFERD_<version>_EXTENDED_OUT and ZUGFERD_<version>_XRECHNUNG_OUT) generate the file names automatically and convert existing PDF files into the required PDF/A format themselves. This page describes the generated files, the call parameters and how the PDF is created.

Generated files

In TOPATH, first specify the output directory and then the variable %FILENAME% as the file name, e.g. TOPATH('/home/ieffect/data/out/%FILENAME%'). The mapping replaces %FILENAME% with a standard file name. The following files are created for each invoice:

File

Name

Location

XML file

ZUGFERD-INVOIC_<document number>_<timestamp>.xml

Directory from TOPATH. After it has been embedded in the PDF, the XML file is removed there, as it is already in the archive folder (ARCPATH).

Audit report

ZUGFERD-INVOIC_<document number>_<timestamp>_audit.pdf

Directory from AUDITPATH, otherwise the directory from TOPATH

ZUGFeRD PDF

ZUGFERD-INVOIC_<document number>_<timestamp>.pdf

Directory from PDFPATH, otherwise the directory from TOPATH

The document number is taken from field HTNDOCNR. Since / and : are not allowed in file names, they are replaced by - in the file name, e.g. RE/2026/0815 becomes the file name ZUGFERD-INVOIC_RE-2026-0815_<timestamp>.xml. The document number in the invoice itself remains unchanged. The timestamp is a Unix timestamp and makes the name unique.

Call parameters

The following parameters can be specified in PARMS when calling RUNMAP. All of them are optional.

Parameter

Description

AUDITPATH

Output path for the audit report. If not specified, the audit report is stored in the directory from TOPATH.

AUDITFILE

File name of the audit report. If not specified, the name of the XML file with the ending _audit.pdf is used.

PDFPATH

Output path for the ZUGFeRD PDF. If not specified, the PDF is stored in the directory from TOPATH.

PDFFILE

File name of the ZUGFeRD PDF. If not specified, the name of the XML file with the ending .pdf is used.

HTPDFFILE

Name of the PDF file specified in field HTPDF, without path and file extension. Can be used as %HTPDFFILE% in TOPATH, AUDITFILE and PDFFILE to name the generated files after the existing PDF (see example 2). Only filled if HTPDF is filled.

The CONVERTPDF parameter no longer exists from i-effect 3.1.19. The conversion to PDF/A is done automatically (see below).

Source of the PDF and conversion to PDF/A

Which PDF is combined with the XML file depends on field HTPDF in header file ZF23INVHT:

HTPDF

Process

Path to an existing PDF, e.g. /home/ieffect/pdf/invoice4711.pdf

The existing PDF is used. i-effect first checks whether it is already PDF/A-1 (a/b) or PDF/A-3 (a/b/u). If not, it is automatically converted to PDF/A-1b with Ghostscript. The file is replaced by the converted version.

empty

The PDF is generated from the created XML file (visual presentation of the invoice).

Before the PDF is created, the invoice is validated and the audit report is stored. If the invoice is not valid, the document is marked as failed (HTSTATE = 2) and no ZUGFeRD PDF is created.

Ghostscript

From i-effect 3.1.19, Ghostscript is shipped with i-effect and no longer needs to be installed separately. The mappings call the script /home/ieffect/current/base/TOOLS/scripts/convertPDF2A1.sh for this. The colour profile and configuration are located in /home/ieffect/ZUGFERD/.

The conversion is logged in the file /home/ieffect/internal/JHJJMMTT-gs.log (JHJJMMTT = date).

For i-effect versions before 3.1.19 see Create PDF/A compatible PDF with Ghostscript (before i-effect 3.1.19).

Examples

Example 1: Standard file names

Creates ZUGFeRD invoices in the COMFORT profile for all data records with client ‘01’. The audit report and the PDF are written to separate directories:

RUNMAP
  MAPID('ZUGFERD_2.5.2_COMFORT_OUT')
  FS(*NONE)
  TOPATH('/home/ieffect/data/out/%FILENAME%')
  ERRPATH('/home/ieffect/data/out/error')
  ARCPATH('/home/ieffect/data/out/archive')
  PARMS(
    (MANDANT '01')
    (AUDITPATH '/home/ieffect/data/out/audit')
    (PDFPATH '/home/ieffect/data/out/pdf')
  )

Generated files:

/home/ieffect/data/out/archive/ZUGFERD-INVOIC_<document number>_<timestamp>.xml
/home/ieffect/data/out/audit/ZUGFERD-INVOIC_<document number>_<timestamp>_audit.pdf
/home/ieffect/data/out/pdf/ZUGFERD-INVOIC_<document number>_<timestamp>.pdf

Example 2: File names from the existing PDF

The file names are formed from HTKEY and the name of the PDF in field HTPDF:

RUNMAP
  MAPID('ZUGFERD_2.5.2_COMFORT_OUT')
  FS(*NONE)
  TOPATH('/home/ieffect/data/out/%HTKEY%_%HTPDFFILE%.xml')
  ERRPATH('/home/ieffect/data/out/error')
  ARCPATH('/home/ieffect/data/out/archive')
  PARMS(
    (MANDANT '01')
    (AUDITPATH '/home/ieffect/data/out/audit')
    (PDFPATH '/home/ieffect/data/out/pdf')
    (AUDITFILE '%HTKEY%_audit_%HTPDFFILE%.pdf')
    (PDFFILE '%HTKEY%_%HTPDFFILE%.pdf')
  )

Generated files with HTPDF = /home/ieffect/pdf/invoice4711.pdf:

/home/ieffect/data/out/archive/<HTKEY>_invoice4711.xml
/home/ieffect/data/out/audit/<HTKEY>_audit_invoice4711.pdf
/home/ieffect/data/out/pdf/<HTKEY>_invoice4711.pdf