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
How to download a flle in PDF format
Moderator: General Moderators
- jimthunderbird
- Forum Contributor
- Posts: 147
- Joined: Tue Jul 04, 2006 3:59 am
- Location: San Francisco, CA
Re: How to download a flle in PDF format
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.
$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.
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: How to download a flle in PDF format
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.
- jimthunderbird
- Forum Contributor
- Posts: 147
- Joined: Tue Jul 04, 2006 3:59 am
- Location: San Francisco, CA
Re: How to download a flle in PDF format
Yes, and this reminds me of PrimoPDF(http://primopdf.com/)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.