atgp/factur-x
Composer 安装命令:
composer require atgp/factur-x
包简介
PHP library to manage your Factur-X / ZUGFeRD 2.0 PDF invoices files
README 文档
README
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 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
- Using setasign\Fpdi
- Extract Factur-X XML from Factur-X PDF invoice
- Using Smalot\PdfParser
- Validate Factur-X XML against the official Factur-X XML Schema Definition
- Using PHP native libxml functions
Table of contents:
Requirements
Installation
Install 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 // 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)) { var_dump($validator->getErrors()); } // ... or throw exceptions if error(s) are occurred $validator->validateWithException($facturxXml);
More options are available, look at source code for more information.
License
This project is licensed under MIT License
Changelog
- v3.4.1 : 2026-07-15
- Fix typo in Fdpi
OuputCondition
- Fix typo in Fdpi
- v3.4.0 : 2026-07-06
- Register CII namespaces on XPath to support custom aliases
- v3.3.0 : 2026-04-17
- Fix automatic tests for PHP 7.4
- Add .gitattributes to exclude files from composer
- v3.2.0 : 2026-03-12
- Cover library with automatic tests
- v3.1.0 : 2026-02-25
- (reader/validator/writer) Handle invalid XML
- (utils) Remove useless ProfileHandler::getFromXml() method
- v3.0.0 : 2026-01-28
- (reader/validator/writer) Throw custom exception to facilitate exception handling
- v2.5.0 : 2026-01-09
- (validator) Upgrade Factur-x XSD to v1.08 — Applicable from 15 January 2026
- (validator) Handle all codes that can be used for credit notes
- v2.4.1 : 2025-11-18
- (reader) Remove backtrace from thrown exception message
- v2.4.0 : 2025-09-24
- (validator) Upgrade Factur-x XSD to v1.07.3
- v2.3.1 : 2025-03-14
- (writer) Fix binary content indicator in header
- v2.3.0 : 2024-12-11
- (ci) Add Github CI : php-stan for PHP versions between 7.4 and 8.4
- v2.2.1 : 2024-10-28
- (reader) Clarify reader extraction method
- v2.2.0 : 2024-10-28
- (validator) Upgrade Factur-x XSD to v1.0.7
- v2.1.0 : 2024-02-26
- (reader) Allow to configure Smalot pdf parser
- 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
atgp/factur-x 适用场景与选型建议
atgp/factur-x 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 928.84k 次下载、GitHub Stars 达 149, 最近一次更新时间为 2019 年 01 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「xml」 「pdf」 「invoice」 「ZUGFeRD」 「factur-x」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 atgp/factur-x 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 atgp/factur-x 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 atgp/factur-x 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Load DOM document safety
Added a method to Laravel response for handling xml response and also converting Eloquent return to XML.
Provides TCPDF integration for Symfony
Uses reflection to map XML to PHP objects.
Xml Template Engine
Alfabank REST API integration
统计信息
- 总下载量: 928.84k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 153
- 点击次数: 30
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-09