Welcome Guest, Not a member yet? Register   Sign In
Printing reports
#1

[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!
#2

[eluser]xwero[/eluser]
With fpdf it's pretty easy to create the pdf you have in mind (take a peak at the second tutorial).
#3

[eluser]agartzia[/eluser]
Thanks! I'll give it a try... With CSS or whatever isn't posible, is it?
#4

[eluser]sharpe[/eluser]
If you have php5 you may try dompdf http://www.digitaljunkies.ca/dompdf/
#5

[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
#6

[eluser]Jauhari[/eluser]
So, which on the best mdavis1982?
#7

[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




Theme © iAndrew 2016 - Forum software by © MyBB