PDF & Document Generation

Processing documents is one direction. Producing them is the other. Enterprises often need to turn structured data back into a formatted document: an invoice, a Fapiao, a tax-compliant e-invoice. PDF and Document Generation lets Staple create those documents from data over the API, using the same validation, queue, and reconciliation model as documents that arrive from outside, so a document you produce is held to the same standard as one you receive.

From Data To A Formatted Document

Send structured data as JSON or XML to the Connect and Operate API and Staple generates a formatted PDF. The generated document then appears in the queue you choose, in the received and completed states, exactly as if it had been scanned in. Request and response detail is in the API documentation.

The Same Queue And Rules In Both Directions

The important design choice is that generation is not a separate, parallel system. A generated document lands in the same queue model as an inbound one, which means it inherits the same validation and business rules, the same review threshold, the same routing, and the same delivery path. A value that would be flagged on a scanned invoice is flagged the same way on a generated one, and the document flows onward through the same process routing and delivery. There is one pipeline to reason about, not two.

Built For E-Invoice And Tax Formats

Generation supports structured e-invoice formats, including ZUGFeRD, the hybrid PDF/A-3 plus XML German invoice standard, and the GOBL canonical model, and it can produce e-invoice XML for Peppol submission. This connects directly to external validation and e-invoicing and to global e-invoicing, so a generated document can be validated against the relevant tax authority before it is issued rather than after it is rejected. Producing a compliant e-invoice and clearing it therefore happen inside one flow. The same applies to jurisdiction-specific instruments such as the Chinese Fapiao, where the generated document has to satisfy the local tax authority's format before it is valid, which is exactly why generation and validation are designed to run together rather than as two disconnected steps a customer has to stitch.

Provenance On What You Issue

A document you generate is a document you are accountable for, so the trust record matters as much on the way out as on the way in. A generated document can carry a Metastructured Data envelope, a signed record of the data it was built from, the model and version that produced it, and when, so the recipient, or an auditor later, can confirm the issued document faithfully represents the underlying data and has not been altered since. For a tax document that has to stand up to a regulator, that is the difference between a PDF and evidence.

Complex Tables Handled Correctly

Generated documents use the same standardized complex-table structure as scanned documents and hybrid XML documents, so line items are consistent across every source. The generator handles wide tables, up to 25 columns and 200 rows, splitting them across multi-page header sets without breaking the table, so a long invoice paginates cleanly instead of losing rows or misaligning columns. Line-item fidelity matters because these documents feed reconciliation downstream, and a table that does not survive generation cleanly cannot be reconciled cleanly.

Update And Regenerate

A generated document is not frozen at the moment of creation. An existing generated PDF can be updated with new data through the API and regenerated, so a correction to the underlying data produces a corrected document rather than requiring a separate edit pass on the file itself. The data stays the source of truth, and the document is always a faithful render of it, which is what keeps a generated invoice and the record behind it from drifting apart over successive corrections.

What Document Generation Does Not Do

Staple generates structured, data-driven documents such as invoices and e-invoices. It is not a page-layout or word-processing tool for free-form design, and some interactive edits, such as manual table restructuring, are intentionally disabled on API-generated documents to preserve their integrity. It produces documents you can trust and reconcile, not marketing collateral.

Proven In Production

A Fortune 500 consumer goods company handling China reimbursements for 8,000 users through SAP Concur needed documents produced and validated against the Chinese tax authority. Staple generated and validated the required documents so reimbursements cleared local tax rules at scale. Across deployments, Staple runs for Fortune 100 companies and global financial institutions in 60 countries at a 100% deployment success rate.

Related Capabilities

External Validation and E-Invoicing

Structured Data Delivery

Embedded Document Generation

Generate A Compliant Document From Your Data

Give us a sample data payload and the target format, and we will generate the document and validate it for you. Book a demo.

Related Topics

See Staple process your documents

Book a 30-minute demo with a document processing specialist.

Book a Demo

Not ready yet?

Take your time to decide.

Read the foodpanda case study