A lightweight C++ utility to programmatically generate professional PDF invoices. Built with libharu, this tool is designed to integrate with backend systems (like Odoo or custom time-tracking databases) to automate billing workflows without requiring heavy GUI applications.
- Vector Graphics: Generates high-quality, printable PDFs.
- Lightweight: No Java or Python interpreter overhead; runs instantly as a compiled binary.
- Customizable: Easy to modify C++ structs to accept data from JSON, CSV, or SQL inputs.
- Automated Calculations: Automatically computes line item totals and grand totals to prevent math errors.
- OS: Ubuntu / Debian
- Library:
libhpdf(LibHaru)
bash sudo apt update sudo apt install libhpdf-dev
Bash
g++ -std=c++17 invoice_gen.cpp -o invoice_gen -lhpdf
Run the tool to generate a standard invoice in the current directory: Bash
./invoice_gen
Output: invoice.pdf
To adapt this for production:
Modify the InvoiceItem struct in invoice_gen.cpp.
Connect the input vectors to your SQL database or JSON parser.
Update the COMPANY_NAME constants.