Peppol Invoice to PDF Ruby

Generate PDF invoices from Peppol BIS Billing 3.0 UBL XML files with invoice lines, VAT breakdown and contact details.

E-Invoice Tools

Peppol Invoice to PDF Ruby Overview

Peppol Invoice to PDF Ruby SDK turns a structured Peppol BIS Billing 3.0 (UBL) XML invoice into a professionally rendered PDF document. The Ruby 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 Ruby 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: .xml

File to be converted. Value can be URL or file content.

PeppolTemplateFile

File Supported formats: .docx

Optional 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 UBL cbc:InvoiceTypeCode: 380 → INVOICE, 381 → CREDIT NOTE, 384 → CORRECTED INVOICE. Other codes are emitted verbatim.
  • {{InvoiceNumber}} — UBL cbc:ID (e.g. INV-2025-001).
  • {{IssueDate}} — UBL cbc:IssueDate (e.g. 2025-03-12).
  • {{DueDate}} — UBL cbc:DueDate (e.g. 2025-04-11).
  • {{Currency}} — UBL cbc:DocumentCurrencyCode (e.g. EUR, USD).
  • {{BuyerReference}} — UBL cbc:BuyerReference (e.g. PO-12345).
  • {{Note}} — UBL cbc:Note.

Parties (supplier from cac:AccountingSupplierParty, customer from cac:AccountingCustomerParty):

  • {{SupplierName}} / {{CustomerName}} — cac:PartyLegalEntity/cbc:RegistrationName, falling back to cac:PartyName/cbc:Name.
  • {{SupplierVatId}} / {{CustomerVatId}} — first non-empty cac:PartyTaxScheme/cbc:CompanyID.
  • {{SupplierAddress}} / {{CustomerAddress}} — composed from cac:PostalAddress as StreetName, 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}} — account cbc:ID.
  • {{PayeeAccountName}} — account cbc: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 when ShowContactDetails is true; the whole block is removed when false.
  • {{#IF ShowNote}} ... {{#ENDIF ShowNote}} — kept when ShowNote is true; removed when false.

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 per cac:InvoiceLine. Columns (in order): Description, Quantity, Unit Price, VAT %, Line Amount.
  • {{VatBreakdown}} — one row per cac: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.

ShowContactDetails

Bool Default: False

When 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: False

When 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: False

When 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 Ruby GEM

1. ConvertAPI Ruby library install

ConvertAPI provides a Ruby Gem that allows you to perform a Peppol Invoice to PDF conversion with just a few lines of code. First, install the ConvertAPI Ruby SDK:

Add this line to your application's Gemfile:
gem 'convert_api'

2. Authenticate your Ruby library

You can obtain your API Token by signing up for a free account. Once you sign up, you'll receive 250 free conversions instantly! Grab your API Token from the account dashboard, and authenticate the ConvertAPI Ruby library like this:

# get your API Token here: https://www.convertapi.com/a/auth
ConvertApi.configure do |config|
   config.api_credentials = 'api_token'
end

3. Convert Peppol Invoice to PDF using Ruby in no time!

Once you have your authentication in place, simply copy-paste this peppol to pdf conversion code snippet into your Ruby project:

Integrate within minutes

Easy Peppol Invoice to PDF automation using our simple Ruby SDK

Try the Peppol Invoice to PDF conversion online

Try it Free

Compatible With all Ruby Frameworks & Tools

Compatible with Ruby Compatible with Ruby on Rails Compatible with Ruby Sinatra Compatible with RSPEC Available on RubyGems Compatible with VS Code Compatible with RubyMine

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

Ready to Streamline Your File Conversions?