Jump to content

Dynamic PDF generation


LostKobrakai
 Share

Recommended Posts

Hi there,

a client of me asked, if it would be possible to automatically generate a pdf invoice after someone ordered something on their simple online shop (no online payment). Does someone know a simple way to accomplish this. The best would be to have some kind of pattern file where just some variables get changed.

Link to comment
Share on other sites

Indeed mpdf came to my mind also. Works easy.

Check by example for html to pdf

And afcourse the Processwire Pages2Pdf Module

If your are able to create a pagetemplate with which you can generate the invoice as html page, converting it to pdf wouldn't be a problem.

It's created serverside, so automatic emailing it to the buyer is also possible.

  • Like 2
Link to comment
Share on other sites

Hi LK,

I was looking at this bit of your issue. 

The best would be to have some kind of pattern file where just some variables get changed.

Both of the modules I suggested allow variable substitutions. I believe adrian and reems have the pdf-generation part of your question covered.

Link to comment
Share on other sites

I had a client ask me the other day if I could recreate an old PDF document.

It's a couple years old and there are a few things they want to have changed.

I don't even know HOW to create a PDF, I was thinking Microsoft Word would have some sort of "Save to PDF" feature, or even Google Docs.

Naturally it would be simpler and "WOW FANTASTIC" to autogenerate a PDF from a ProcessWire page :D:);)

Link to comment
Share on other sites

I'd go with a PDF library like mpdf or tcpdf which create your files serverside - they all are similair (depending on the same basic library called fpdf).

If you can create your invoice in HTML, you should try the mpdf library, simply because the support of converting HTML/CSS to a PDF file is really nice.

If you install my Pages2Pdf module, you have a separate module called WirePDF that is a wrapper around the mpdf library, optimized for ProcessWire.

Here is a readme how you could use the module to save/download a PDF file from HTML markup or a ProcessWire template:

https://github.com/wanze/Pages2Pdf#wirepdf

  • Like 3
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...