flashmonkey Posted February 28, 2008 Share Posted February 28, 2008 :'( :'( 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 :-\ :-\ Quote Link to comment https://forums.phpfreaks.com/topic/93514-help-with-pdf-creation/ Share on other sites More sharing options...
Psycho Posted February 28, 2008 Share Posted February 28, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/93514-help-with-pdf-creation/#findComment-479220 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.