Thread: Output to PDF
View Single Post
Old 04-03-2009, 06:34 AM   #23 (permalink)
xenon
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