Zack Tanner
Zack Tanner

Reputation: 2590

Writing HTML with PHP variables to PDF file?

I'm looking to write HTML tables, which contain PHP variables inside the columns, to a unique PDF file. From the way it looks, there's no way to simply write an HTML table to a PDF file. Does anyone have any tools that do this, or a script that would point me in the right direction?

Thanks!

Upvotes: 2

Views: 5277

Answers (2)

Mark Baker
Mark Baker

Reputation: 212412

I've recently been testing DomPDF (as mentioned by julesj) and mPDF as alternatives to tcPDF. I encountered a few problems with html tables when using DomPDF (e.g. missing the first row on each page), and found mPDF fractionally faster, but needing significantly more memory. However, the generated PDF file was much cleaner than that generated using DomPDF. Conversely, DomPDF has a much smaller disk size footprint.

Upvotes: 1

julesj
julesj

Reputation: 754

You might want to check out dompdf

Upvotes: 3

Related Questions