ZUGFeRD / Factur-X support

Informations

Author: Olivier
License: FPDF

Description

This script adds support for the ZUGFeRD / Factur-X standard. The method to set the invoice XML file is:

SetXmlFile(string file [, string profile])

file: path of the XML file to embed into the PDF.
profile: profile name. Default value: EN 16931.

The supported profiles are the following: No validation is performed on the XML file.

Note: the PDF must comply with the PDF/A standard, which means that all fonts must be embedded (you can't use the standard fonts).

Example

This example uses a DejaVu font:
<?php
require('zugferd.php');
define('FPDF_FONTPATH', '.');

$pdf = new PDF_ZUGFeRD();
$pdf->AddFont('DejaVuSansCondensed', '', 'DejaVuSansCondensed.php');
$pdf->SetFont('DejaVuSansCondensed', '', 16);
$pdf->AddPage();
$pdf->Write(10, 'This invoice is ZUGFeRD-compliant.');
$pdf->SetXmlFile('factur-x.xml');
$pdf->Output();
?>
View the result here.

Download

ZIP | TGZ