Jump to content

Recommended Posts

:'( :'( Guys I have a report generated from a mysql database in a tabulated format. How to I get a pdf file with that data using php??? ??? I've googled it and the results have not been up to the mark. Anybody knows any good tutorials about this topic. I have to submit this file before this weekend or i may get fired. Any help will be highly appreciated. Lots of thanks in advance :-\ :-\

Link to comment
https://forums.phpfreaks.com/topic/93514-help-with-pdf-creation/
Share on other sites

Well, there are a few different ways to attack this problem. unfortunately you're not in a position to try each to find the best fit.

 

If you create your own code using the PDF Library within PHP the process may be very different from any previous programming you have done. With PDF creation you don't just "print" text to the page. You need to first create the page (size) set the font properties and then select the coordinates on the page (in points: 72dpi) that you want to place the text. Also, it will not wrap text for you. If you need text to break accross multiple lines then you need to break it apart in the code and place eah part on the page according to the appropriate coordinates.

 

There are probably some free PHP classes that would make this easier, but I haev never used any so I can't recommend any.

 

Lastly you could get a 3rd party utility that will convert HTML output to PDF. So, all you need to do is have a page that outputs the format in HTML format of how you want the PDF created. You don't need to display that page tot he user, just pass the URL to the app. A quick search found a free app: http://www.rustyparts.com/pdf.php But, I don't know about it's quality.

 

In previous companies we have paid a quite a bit for robust applications to do this. here are a few examples:

http://www.activepdf.com/

http://www.realobjects.com/PDFreactor.808.0.html?gclid=CNT_3Mud55ECFQJEPAodgiZPgA

 

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.