Jump to content

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.

Thanks,

David.
Link to comment
https://forums.phpfreaks.com/topic/9743-dynamic-pdf-creation/
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!
Link to comment
https://forums.phpfreaks.com/topic/9743-dynamic-pdf-creation/#findComment-36639
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.