Page 1 of 1
How to download a flle in PDF format
Posted: Sun Jan 13, 2008 5:14 am
by drors30
Hi,
I want to save a php file in PDF format by clicking a button and then save it to my local machine.
How can i achieve this ?
Thanks
Re: How to download a flle in PDF format
Posted: Sun Jan 13, 2008 8:26 am
by jimthunderbird
I would first try to get the file content using:
$self_content = file_get_contents(__FILE__);
then will try to dump $self_content into PDF, you might want to check out
http://www.fpdf.org/ on how to create PDF file in php.
Re: How to download a flle in PDF format
Posted: Sun Jan 13, 2008 8:38 am
by Kieran Huggins
If it's only for you, you could use Acrobat to "create PDF from webpage" (which often looks nasty) or you could print to PDF.
Re: How to download a flle in PDF format
Posted: Sun Jan 13, 2008 8:46 am
by jimthunderbird
Kieran Huggins wrote:If it's only for you, you could use Acrobat to "create PDF from webpage" (which often looks nasty) or you could print to PDF.
Yes, and this reminds me of PrimoPDF(
http://primopdf.com/)