Peppol Invoice to PDF PHP Overview
Peppol Invoice to PDF PHP SDK turns a structured Peppol BIS Billing 3.0 (UBL) XML invoice into a professionally rendered PDF document. The PHP SDK extracts invoice header fields, supplier and customer details, monetary totals, invoice line items, and VAT breakdown from the Peppol XML and renders them into a ready-to-share PDF. Conditional sections such as contact details and free-form notes can be toggled on or off, giving you full control over the final layout. Use this PHP SDK to automate the generation of compliant electronic invoices in PDF format directly from your accounting or ERP system.
Lightning Fast Conversions
Process and convert files in seconds with our high-performance cloud infrastructure.
Accuracy Guaranteed
Our advanced algorithms ensure pixel-perfect and content-accurate file conversions.
Enterprise-Grade Security
ISO 27001, HIPAA, and GDPR compliant with encrypted file processing.
Global Infrastructure
Strategically located servers ensure low latency and high availability worldwide.
Developer Friendly
Comprehensive SDKs and clear documentation for quick and simple integration.
Time-Saving Automation
Automate repetitive document workflows and focus on what matters most.
Customizable Parameters
Fine-tune your automation with these powerful conversion options
File
File Supported formats: .xmlFile to be converted. Value can be URL or file content.
PeppolTemplateFile
File Supported formats: .docxOptional custom DOCX template used to render the Peppol invoice. The Peppol BIS Billing 3.0 (UBL) XML supplied as the source file is parsed and its values are substituted into the template's {{placeholder}} tokens. When this parameter is omitted, the bundled default template is used.
Text placeholders
Invoice identification:
{{DocumentType}}— human-readable document type, resolved from UBLcbc:InvoiceTypeCode:380→INVOICE,381→CREDIT NOTE,384→CORRECTED INVOICE. Other codes are emitted verbatim.{{InvoiceNumber}}— UBLcbc:ID(e.g.INV-2025-001).{{IssueDate}}— UBLcbc:IssueDate(e.g.2025-03-12).{{DueDate}}— UBLcbc:DueDate(e.g.2025-04-11).{{Currency}}— UBLcbc:DocumentCurrencyCode(e.g.EUR,USD).{{BuyerReference}}— UBLcbc:BuyerReference(e.g.PO-12345).{{Note}}— UBLcbc:Note.
Parties (supplier from cac:AccountingSupplierParty, customer from cac:AccountingCustomerParty):
{{SupplierName}}/{{CustomerName}}—cac:PartyLegalEntity/cbc:RegistrationName, falling back tocac:PartyName/cbc:Name.{{SupplierVatId}}/{{CustomerVatId}}— first non-emptycac:PartyTaxScheme/cbc:CompanyID.{{SupplierAddress}}/{{CustomerAddress}}— composed fromcac:PostalAddressasStreetName, CityName, PostalZone, Country(empty parts skipped).
Contact (rendered inside {{#IF ShowContactDetails}} ... {{#ENDIF ShowContactDetails}}):
{{SupplierContactName}}/{{CustomerContactName}}—cac:Contact/cbc:Name.{{SupplierContactPhone}}/{{CustomerContactPhone}}—cac:Contact/cbc:Telephone.{{SupplierContactEmail}}/{{CustomerContactEmail}}—cac:Contact/cbc:ElectronicMail.
Totals (from cac:LegalMonetaryTotal and cac:TaxTotal):
{{TaxExclusiveAmount}}— net total before tax.{{TaxAmount}}— total VAT amount.{{PrepaidAmount}}— amount already paid.{{PayableAmount}}— final amount due.
Payment (from cac:PaymentMeans/cac:PayeeFinancialAccount):
{{PayeeIBAN}}— accountcbc:ID.{{PayeeAccountName}}— accountcbc:Name.
Conditional sections
Wrap optional content in the template so it can be toggled via the ShowContactDetails and ShowNote parameters. The wrapper tags themselves are removed from the rendered output:
{{#IF ShowContactDetails}} ... {{#ENDIF ShowContactDetails}}— kept whenShowContactDetailsistrue; the whole block is removed whenfalse.{{#IF ShowNote}} ... {{#ENDIF ShowNote}}— kept whenShowNoteistrue; removed whenfalse.
Table placeholders
Place each table placeholder in a single cell of a one-row template table — the row is cloned for each item, preserving formatting.
{{InvoiceLines}}— one row percac:InvoiceLine. Columns (in order): Description, Quantity, Unit Price, VAT %, Line Amount.{{VatBreakdown}}— one row percac:TaxTotal/cac:TaxSubtotal. Columns (in order):- VAT Category label —
VAT {percent}%for rated categories (e.g.VAT 21%), or a descriptive label with UNTDID 5305 code for non-rated ones:Standard rate (S),Zero-rated (Z),Exempt (E),Reverse charge (AE),Intra-community (K),Export (G),Out of scope (O),Canary Islands IGIC (L),Ceuta/Melilla IPSI (M). - Tax Amount with currency (e.g.
73.50 EUR). - Rate % (e.g.
21%,8.5%). - Taxable Amount.
- VAT Category label —
ShowContactDetails
Bool Default: FalseWhen enabled, supplier and customer contact details (name, phone, email) are included in the rendered invoice; when disabled, the contact block is hidden.
Takes effect by default when the bundled template is used. When a custom PeppolTemplateFile is supplied, the contact block must be wrapped with {{#IF ShowContactDetails}} ... {{#ENDIF ShowContactDetails}} for this parameter to have any effect.
ShowNote
Bool Default: FalseWhen enabled, the invoice note is included in the rendered invoice; when disabled, the note block is hidden.
Takes effect by default when the bundled template is used. When a custom PeppolTemplateFile is supplied, the note block must be wrapped with {{#IF ShowNote}} ... {{#ENDIF ShowNote}} for this parameter to have any effect.
StoreFile
Bool Default: FalseWhen the StoreFile parameter is set to True, your converted file is written to ConvertAPI’s encrypted, temporary storage and made available via a time-limited secure download URL, valid for up to 3 hours. After this period, the file is permanently deleted.
When StoreFile is set to False, conversion happens entirely in-memory. The raw file bytes are streamed back in the API response without touching disk or external storage, ensuring maximum security and zero persistence so that only you can access the content.
Step-by-Step Guide
Easy Peppol Invoice to PDF integration programmatically using our simple library for PHP
1. Install the PHP SDK
ConvertAPI provides a PHP library that allows you to perform a Peppol Invoice to PDF conversion with just a few lines of code. Convert Peppol Invoice to PDF documents using PHP programming language with no effort at all!
composer require convertapi/convertapi-php
Or install it manually using ConvertApi autoloader:
require_once('/path/to/convertapi-php/lib/ConvertApi/autoload.php');
2. Peppol Invoice to PDF - complete code snippet for PHP
Once you have your authentication in place, simply copy-paste this peppol to pdf conversion code snippet into your PHP project:
Integrate within minutes
Easy Peppol Invoice to PDF automation using our simple PHP SDK
Compatible With all PHP Frameworks & Tools
Businesses trust us
Highest rated File Conversion API on major B2B software listing platforms: Capterra, G2, and Trustpilot.
"ConvertAPI has been a game-changer for our document automation workflows. Their conversion accuracy and API reliability are unmatched in the industry for over 7 years."
"ConvertAPI is a reliable, cost-effective solution with a proven track record of stability. It has grown significantly in maturity, adopting enterprise-grade practices over the years."
"We've integrated ConvertAPI across our entire document processing platform. The performance is exceptional and the support team is always responsive. Highly recommended!"
Enterprise-Grade Security
We ensure that all document processing is handled securely in the cloud, adhering to industry-leading standards like ISO 27001, GDPR, and HIPAA. To enhance security even further, we can ensure that no files or data are stored on our servers and never leave your country.
Learn more about security