By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,717 Members | 1,233 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,717 IT Pros & Developers. It's quick & easy.

Saving a Pdf file when clicked on the download button

P: 1
HI

I want to save a file when clicked on the download button .please help .

thanks
Jun 13 '07 #1
Share this Question
Share on Google+
1 Reply


epots9
Expert 100+
P: 1,351
Hi cnusangam16 welcome to TSDN,

http://www.php.net/manual/en/ref.pdf.php will give u all the instructions u needs and also tell u what extensions to install.

once u have the extensions installed here is a small sample:
[PHP]
<?php
// create handle for new PDF document
$pdf = pdf_new();

// open a file
pdf_open_file($pdf, "philosophy.pdf");

// start a new page (A4)
pdf_begin_page($pdf, 595, 842);

// get and use a font object
$arial = pdf_findfont($pdf, "Arial", "host", 1); pdf_setfont($pdf, $arial, 10);

// print text
pdf_show_xy($pdf, "There are more things in heaven and earth, Horatio,", 50, 750); pdf_show_xy($pdf, "than are dreamt of in your philosophy", 50, 730);

// end page
pdf_end_page($pdf);

// close and save file
pdf_close($pdf);
?>
[/PHP]

good luck
Jun 13 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.