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 04-02-2009, 03:43 PM   #21 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Correct. See, my issue is this. I have a bunch of flash graphs, and dynamically generated content.

So pretend you are looking at your IRA/401K statement with all sorts of data, all neatly laid out.

If the user wishes to "save" that page, there will be a PDF button that they click on, and save the current data as PDF. But I'd like to keep the layout of the webpage in the PDF too.

I just don't want it to save a bunch of numbers like it would if it were a CSV file.

So conceptually, I'm having a hard time figuring out how to get the entire webpage into the PDF....

It's almost as if I have to somehow capture every HTML tag, put it into an array, and HOPE that there's a function that can read the HTML tags and somehow put that into PDF format for saving...
allworknoplay is offline  
Reply With Quote
Old 04-03-2009, 03:55 AM   #22 (permalink)
The Addict
 
CoryMathews's Avatar
 
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
CoryMathews is on a distinguished road
Default

Ah yes. My code fails. I understood the question correctly just gave a wrong code snippet. I had that on my list of snippets to test and I had already tested

header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=hello.doc");

And it would make the user be prompted to save the page as a word doc. So I figured the same would go with the .pdf, but I was wrong.
CoryMathews is offline  
Reply With Quote
Old 04-03-2009, 06:34 AM   #23 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

Quote:
Originally Posted by CoryMathews View Post
Ah yes. My code fails. I understood the question correctly just gave a wrong code snippet. I had that on my list of snippets to test and I had already tested

header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=hello.doc");

And it would make the user be prompted to save the page as a word doc. So I figured the same would go with the .pdf, but I was wrong.
Yes, but what you posted won't work either (unless you echo an existing .doc's file contents). Otherwise, you would need to add alot of headers (as in header blocks in the DOC standard created by Microsoft, not PHP headers), plus other instructions (or use COM, I think that would work). But that's not really the request here, the post is about creating PDF documents from PHP without any use of third party software.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Old 04-03-2009, 12:17 PM   #24 (permalink)
The Addict
 
CoryMathews's Avatar
 
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
CoryMathews is on a distinguished road
Default

Nope it works, tested and implemented it already.
CoryMathews 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Data output Sakakuchi Advanced PHP Programming 2 02-08-2009 02:26 PM
Save output from foreach into an array Sam Granger Absolute Beginners 2 01-15-2009 02:07 AM
Unexpected characters in output Killswitch Absolute Beginners 2 12-20-2008 04:29 AM
PHP Security: Escape Output nuweb General 4 11-24-2008 08:00 PM
Smarty output buffering? Aaron Libraries & Extensions 4 08-13-2008 09:35 AM


All times are GMT. The time now is 08:51 AM.

 
     

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