Topic: Question about PDF and php (Read 1535 times)
Sandwich Artist
Posts: 25
186 credits Members referred : 0
« on: Mar 12, 2008, 09: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: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Mar 12, 2008, 11:16:49 pm »
check fpdf.org or search for fpdi to add content to existing pdfs
Chicken-run Manager
Posts: 9
96 credits Members referred : 0
« Reply #2 on: Apr 30, 2008, 07:08:47 pm »
i don't have much idea about this. you should try with google to solve .
<snip /> go away spammer!
« Last Edit: Apr 30, 2008, 07:34:54 pm by Olaf »
What a dork
Posts: 16
116 credits Members referred : 1
Where are my glasses?
Posts: 23
146 credits Members referred : 0
« Reply #4 on: May 27, 2008, 12: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