pdfxml
v0.2.2
Published
> Generate high-quality PDF documents using XML.
Maintainers
Readme
pdfxml
Generate high-quality PDF documents using XML.
pdfxml is an open-source library for generating PDF documents from XML templates. It was created to make PDF generation more organized, maintainable and scalable, without sacrificing performance or flexibility.
Whether you are building reports, invoices, labels, receipts, fiscal documents or any other printable document, pdfxml provides a simple and declarative way to describe your layouts.
Why pdfxml?
pdfxml was born while I was developing PDF reports for real-world applications.
During that process, I found myself facing the same challenges repeatedly. Many available solutions required commercial licenses, while others were excellent for simple documents but became difficult to maintain as layouts grew in complexity.
My goal was to build a tool that allowed complex documents to remain simple to develop, easy to maintain and pleasant to evolve over time.
Instead of creating PDFs entirely through imperative code, pdfxml introduces a declarative XML language that keeps document structure organized and readable.
Today, pdfxml is used in production projects and has proven to be reliable for generating different kinds of documents. I'm excited to see what other developers and companies will build with it.
Why XML?
XML was chosen intentionally.
It is a mature, well-known and highly structured markup language that is easy to read, generate and validate.
For developers already working with backend systems, APIs or integrations, XML usually has a very small learning curve while providing an expressive way to describe complex document layouts.
Features
- Declarative XML syntax
- High-quality PDF generation
- Report generation
- Invoice support
- Receipt generation
- Label generation
- SVG rendering
- QR Code support
- Barcode support
- Custom page sizes
- Margin configuration
- Custom fonts
- Multi-page documents
- TypeScript support
- CLI support
- Open Source
- Apache 2.0 License
Who is pdfxml for?
pdfxml is suitable for anyone who needs to generate PDF documents dynamically, including:
- SaaS applications
- ERP systems
- Automation platforms
- Financial systems
- Fiscal systems
- Reporting tools
- Developers
- Students
- Programming enthusiasts
If you understand XML, you'll feel at home.
Installation
npm install pdfxmlor
pnpm add pdfxmlor
yarn add pdfxmlQuick Example
<Column>
<Text FontSize="14">Hello World</Text>
<Row Gap="10">
<Text>Left</Text>
<Text>Right</Text>
</Row>
</Column>pdfxml --xml=document.xml --output=document.pdf --format=A4More complete examples are available in the documentation.
Documentation
The complete documentation includes:
- XML language reference
- Supported elements
- Styling
- Images
- Tables
- QR Codes
- Barcodes
- SVG
- Fonts
- CLI
- Examples
Documentation is available on the project website.
Contributing
Contributions are always welcome.
Whether you found a bug, have an idea for a new feature or simply want to improve the documentation, feel free to open an issue or submit a pull request.
A personal note
pdfxml started as a solution to my own problem.
After using it successfully, I decided to make it open source because I believe more developers should have access to a modern, practical and free tool for PDF generation.
I genuinely hope this project helps you build something amazing, and I'm looking forward to seeing what the community creates with it.
License
pdfxml is licensed under the Apache License 2.0.
You are free to use it in personal, academic and commercial projects while respecting the terms of the license.
See the LICENSE file.
