This topic is locked

Create Invoice or Reports with PDFMake

4/10/2025 1:16:16 PM
PHPRunner Tips and Tricks
fhumanes author

img alt
This solution is quite different from all the others I have on the blog. It's a JavaScript solution .

Working in the REACT environment , whose main language is JavaScript, I was looking for a solution to make PDF documents and I saw and tried PDFMake and I was surprised by these features:

  • Simple to understand how it works and quick to execute.
  • It doesn't have a design tool, but it does have a testing solution, which is very useful for designing and testing the report you want to generate.
  • It scales perfectly (it doesn't scale like the HTML to PDF solution), so you can define formal documents such as delivery notes, invoices, official documents, etc.
  • You can configure PDF characteristics and page size
  • You can define headers and footers, allowing you to print page numbers. In tables, it automatically manages the ending of one page and the heading of the next.
  • It has more features, but the ones above seemed to me to be the most relevant.

Objetive

Create invoices or other documents in PDF format (with quality) easily and quickly.

DEMO: https://fhumanes.com/invoice_pdfmake/

img alt

img alt
From the View option, in the "Invoice" table, you can access the button to generate the PDF.

If you're interested in this topic, continue reading the full article at this link.