Dynamic PDF Creation
Posted 16 May 2006 - 12:53 AM
I'm starting to do some work where dynamic PDF creation would be REALLY helpfull. I have played a bit but just with standard, write text, continue text and place image etc...
What I will be doing, is outputting a report to a PDF where the data could be 1 line, 2 paragraphs or 2 pages.
How can I work out how much of the page was taken up by the text, then put a border around it etc...
Any info is appreciated.
Posted 16 May 2006 - 06:20 PM
[a href=\"http://www.fpdf.org\" target=\"_blank\"]http://www.fpdf.org[/a]
Its cell() and multicell() functions will output text and put the border round it.
Donations gratefully received
|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts
Posted 17 May 2006 - 03:41 PM
If you are doing the former, you will need to use strict styles within the HTML page to control the output. For example, knowing that there are 72 pixels (or points) per inch. So if you want 1" margins on the sides you should create a table with an exact width of 72 x 6.5. And then specify an exact point size for the font. Then put a border on the containing table(s). Depending on the type of format for your data, you may or may not be able to control page breaks (there is a CSS control for page breaks).
If you are building the PDFs by creating postscript first, you have FULL control over all elements. You would just need to learn PostScript programming!
I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users