TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-11-2009, 08:23 PM   #1 (permalink)
The Acquainted
 
Randy's Avatar
 
Join Date: May 2007
Location: Your G/F's Closet
Posts: 114
Thanks: 7
Randy is on a distinguished road
Default 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
__________________
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25 - Andrew Rutherford
Send a message via AIM to Randy Send a message via MSN to Randy
Randy is offline  
Reply With Quote
Old 06-11-2009, 10:03 PM   #2 (permalink)
The Wanderer
 
Join Date: May 2009
Location: Columbus, Ohio
Posts: 10
Thanks: 0
wjgilmore is on a distinguished road
Default

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
__________________
==
Author, "Easy PHP Websites with the Zend Framework"
http://www.easyphpwebsites.com
wjgilmore is offline  
Reply With Quote
Old 06-12-2009, 09:17 AM   #3 (permalink)
The Wanderer
 
Join Date: Jun 2009
Posts: 7
Thanks: 0
zongliang is on a distinguished road
Default

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.
zongliang is offline  
Reply With Quote
Old 06-12-2009, 06:19 PM   #4 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

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.
__________________

Village Idiot is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 07:55 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design