Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating PDFs with PHP [closed]

Tags:

php

pdf

dompdf

I have a PHP application and a need to generate a PDF with the result of query. The easiest way a found to do this was to use the DOMPDF to generate the PDF for me. So a made a function that generates the HTML for me then a pass this to DOMPDF. In the development and testing enviroment everything was fine but on production enviroment I had some problems with memory usage.

So I would like to know if my strategy was the best one or if there's a better and easy way to do this.

How would you do that?

like image 277
Luiz Guilherme Avatar asked Nov 05 '08 16:11

Luiz Guilherme


1 Answers

I once did a PHP project generating PDF. I used FPdf.

I never had any memory problems. It's free, it's pure PHP code. You don't have to load any extensions.

I don't know if there's some helpers to auto-generate document from a query, but in the website, you have some scripts that shows how to use it with MySql.

HTH

like image 104
vIceBerg Avatar answered Oct 05 '22 03:10

vIceBerg