TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Advanced PHP Programming (http://www.talkphp.com/advanced-php-programming/)
-   -   Pdf? (http://www.talkphp.com/advanced-php-programming/4535-pdf.html)

Randy 06-11-2009 08:23 PM

Pdf?
 
So many websites have downloadable pdf articles from their news articles or something like that am I curious if there is a way to take data from a MySQL database and insert it into one.

For example, on a project I am making i have a page called 'servers.php' i am curious if there is a way to make a folder called /pdf/ for when the user clicks download it takes them to a page like '/pdf/servers.pdf'

Thanks,
Randy

wjgilmore 06-11-2009 10:03 PM

Hi Randy,

Yes indeed this is possible, check out PHP's PDF extension: http://us.php.net/manual/en/book.pdf.php.

You might also check out iText http://www.lowagie.com/iText/. You can use it to do things like modify PDFs in real-time (for instance to add a watermark).

Hope this helps!
Jason

zongliang 06-12-2009 09:17 AM

I do not think we should create a pdf file, we just put pdf file in /pdf/, then get access to it, it will download automatically.

Village Idiot 06-12-2009 06:19 PM

Unless you have a specific reason for dynamically generating a PDF, it is probably a good idea not to do it unless you have some sort of caching function. Generating things like this are intense on the server, especially when done in large volumes. I would advise doing what you need to do to each PDF, storing them then linking them in a database opposed to dynamically generating the content each time.


All times are GMT. The time now is 02:41 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0