Topic: Question about PDF and php (Read 702 times)
Sandwich Artist
Posts: 25
186 credits Members referred : 0
« on: Mar 12, 2008, 10:13:55 PM »
Does any one know if its possible to take variables from PHP and insert them into a PDF document? I'm working on something now that would make things a lot easier if this was possible? Any ideas
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6557
40174 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Mar 13, 2008, 12:16:49 AM »
check fpdf.org or search for fpdi to add content to existing pdfs
I love Pokemon
Posts: 13
86 credits Members referred : 0
« Reply #4 on: May 27, 2008, 01:29:36 PM »
<?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); ?>
Save this file, and then browse to it through your Web browser. PHP will execute the script, and a new PDF file will be created and stored in the location specified at the top of the script.
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7654