Kay1021 Posted May 25, 2009 Share Posted May 25, 2009 Is there a way to take your data from your db and create a pdf. Basically i have a table of information sectioned by month and I want to give the user the option to save that information, ideally in pdf format so they can have a copy and print etc. I want them to be able to choose by month or all the months. Thanks Quote Link to comment Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted May 25, 2009 Share Posted May 25, 2009 There many way just ask google or take a look at this http://www.fpdf.org/ Quote Link to comment Share on other sites More sharing options...
Kay1021 Posted May 26, 2009 Author Share Posted May 26, 2009 I took a look at that...and i've been trying to search google...but i'm not sure i'm getting it. In the fpdf thing the examples just show them filling it with information like Hello World or from a text doc....i'm just not sure how I do it from the database....my information is already presented on the screen in a table...i'm just not understanding how to transform that into a pdf using that fpdf. I was hoping there was a simple tutorial out there...but i haven't found one yet. Thanks for the suggestions though Quote Link to comment Share on other sites More sharing options...
Psycho Posted May 26, 2009 Share Posted May 26, 2009 There are several solutions to your problem and I expect each of them will require you to learn some new things. Here are a few possibilities 1) Get a 3rd party, server-side utility that will allow you to "point" the utility to the web page in question and output a PDF of the page. This would probably be the simplest solution, but it will cost money and the format of the PDF will look just like the HTML page (unless you provide code to handle the page differently for the PDF creation). Personally I would think the PDF should be constructed differently than the HTML representation. This would require installation of the 3rd party app. If you're on a shared server this may not be possible. 2) Use PHP's built in PDF creation functionality: http://us2.php.net/pdf This will require you to learn all the ins and outs of this process. It will probably take the most time, but you will get the most personal benefit from it. And it would be free. This requires that this functionality is enabled on the server. May be an issue for a shared server that you do not control. The link theonlydrayk posted above appears to be a Class that utilizes PHPs built in functionality but makes the process easier to implement. See comments below. 3) Implement some other 3rd party tool for PDF creation. This can be various implementation such as creating raw PostScript code and distilling it on the server using Adobe product or other tools (e.g. Active PDF). Or it could be something proprietary. This will give you the greatest amount of flexibility. But, it will cost money and will bethe most difficult to master. This would require installation of the 3rd party app. If you're on a shared server this may not be possible. I think #2 is what you want. The "Hello World" example is just that - an example. You would want to create your own code to have the dynamic content from the database used instead. Since we don not know your content or how you want it output, you are on your own at this point. Quote Link to comment Share on other sites More sharing options...
redarrow Posted May 26, 2009 Share Posted May 26, 2009 or add a online free service to the web site it self. http://www.pdfonfly.com/ but learning something new is better. Quote Link to comment Share on other sites More sharing options...
Kay1021 Posted May 26, 2009 Author Share Posted May 26, 2009 Thanks...i guess i'll try #2....might take me a while...but hopefully i figure it out... basically my table is like TASK | CHECK | DATE | COMMENT ---------------------------------------------------------------------------------------------------- Clean bathroom | YES | 09/10/08 | Done by Fred ---------------------------------------------------------------------------------------------------- Wash dog | NO | 29/12/08 | Dog unavailable ---------------------------------------------------------------------------------------------------- Sweep Floors | YES | 01/04/09 | No problems ---------------------------------------------------------------------------------------------------- Wash Windows | YES | 11/05/09 | Window broke all that information is from the database Quote Link to comment 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.