Skip to content
/ factur-x Public

PHP library to manage your Factur-X / ZUGFeRD 2.0 PDF invoices files


Notifications You must be signed in to change notification settings


Folders and files

Last commit message
Last commit date

Latest commit



49 Commits

Repository files navigation

PHP Factur-X library

Factur-X is a Franco-German e-invoicing standard which complies with the European e-invoicing standard EN 16931. The Factur-X specifications are available on the FNFE-MPE website in English and French. The Factur-X standard is also called ZUGFeRD 2.2 in Germany.

This library enable you to manage your Factur-X PDF invoices files :

  • Generate Factur-X PDF invoice from regular PDF invoice and Factur-X XML file
  • Extract Factur-X XML from Factur-X PDF invoice
  • Validate Factur-X XML against the official Factur-X XML Schema Definition

Table of contents:


  • PHP 7.4+
  • Composer
  • FPDI (MIT License)
  • Smalot (LGPL License)


Install with Composer

composer require atgp/factur-x


You can see the code from test page from "tests" directory, also here some simple examples of implementation :

// Include or autoload (with Composer) all library classes

// Generates Factur-X PDF invoice from PDF and Factur-X XML
$writer = new \Atgp\FacturX\Writer();
$facturxPdf = $writer->generate($pdf, $facturxXml);

// Extracts Factur-X XML
$reader = new \Atgp\FacturX\Reader();
$facturxXml = $reader->extractXML($facturxPdf);

// Validates Factur-X XML against official Factur-X XML Schema Definition 
$validator = new \Atgp\FacturX\XsdValidator();
if (false === ($isValid = $validator->validate($facturxXml)) {
// ... or throw exceptions if error(s) are occurred

More options are available, look at source code for more information.


This project is licensed under MIT License


  • v2.0.0 [BC] : 2023-11-06
    • Requires php 7.4+
    • Refactor classes to clarify uses
    • Simplify requirements for "smalot/pdfparser"
    • Import external links on generated factur-x pdf
  • v1.1.0 : 2019-01-09
    • Upgrade Factur-x xsd to v1.0.06
    • Fix PDF-A compliance regarding endobj and ICC profile
  • v1.0.0 : 2019-01-09
    • Requires php 5.6+
    • First version of the library to read, check and write factur-x documents