Printing reports |
[eluser]agartzia[/eluser]
Hi there! For very first time in my web-development career, I need to print out some PHP-generated reports to paper. Well, some HTML, a browser and a printer... The problem comes when the client wants to add a header and a footer in each page of the reports. Sometimes, the content fits in one page. But sometimes it doesn't, so I'll need to print the header and footer in each printed page (with some mark as "Page 1 out of 15", the logo, and details on each report). I've thought of PDF, but's certainly messy and very very complex. Any ideas? Thanks!
[eluser]agartzia[/eluser]
Thanks! I'll give it a try... With CSS or whatever isn't posible, is it?
[eluser]sharpe[/eluser]
If you have php5 you may try dompdf http://www.digitaljunkies.ca/dompdf/
[eluser]mdavis1982[/eluser]
Be aware that DomPDF uses LOTS of memory... I just had an issue where I needed to generate a PDF with 97 pages... DomPDF just wouldn't handle it without me assigning almost 7GB of RAM to it! And even then it took almost 1.5 hours to generate the PDF! Just my two cents! Matt
[eluser]mdavis1982[/eluser]
In the end, I ended up just generating an HTML page that was printer friendly and letting the user view that. It seemed to be the most reliable solution and one that I could guarantee working! Cheers... Matt |
Welcome Guest, Not a member yet? Register Sign In |