Jump to content


This topic is now archived and is closed to further replies.


Dynamic PDF Creation

Recommended Posts

Hey everyone,

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.



Share this post

Link to post
Share on other sites
Have you looked at FPDF?

[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.

Share this post

Link to post
Share on other sites
What is your process for creating the PDFs? Are you pasing an HTML page to a PDF library function or are you creating dynamic psotscript files and distilling them?

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!

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.