atgp/factur-x

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

v1.0.1 2019-01-16 10:09 UTC

README

Factur-X is the e-invoicing standard for France and Germany. The Factur-X specifications are available on the FNFE-MPE website. The Factur-X standard is also called ZUGFeRD 2.0 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
  • Check Factur-X XML against the official Factur-X XML Schema Definition

Table of contents:

Requirements

  • Apache2
  • PHP 5.6+
  • Composer
  • FPDI (MIT License)
  • Smalot (LGPL License)

Installation

Download with Composer

composer require atgp/factur-x

Usage

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

<?php
// Include or autoload (with Composer) all library classes

// Generating Factur-X PDF invoice from PDF and Factur-X XML
$facturx = new Facturx();
$facturxPdf = $facturx->generateFacturxFromFiles($pdf, $facturxXml);

// Extract Factur-X XML
$facturx = new Facturx();
$facturxXml = $facturx->getFacturxXmlFromPdf($facturxPdf);

// Check Factur-X XML against official Factur-X XML Schema Definition 
$facturx = new Facturx();
$isValid = $facturx->checkFacturxXsd($facturxXml);

More options are available, look at source code for more informations

License

This project is licensed under MIT License