Good PDF Tutorial?
Posted: Thu Nov 03, 2005 5:28 pm
I've found a couple, but apparently I'm missing some key concept or something. I tried this incredibly simple script, for the most part copied and pasted from the php.net site:
It creates no file called "test.pdf". Creates no file at all. What could I have done wrong? I tried it with the pdf_delete both commented and uncommented; I thought that might make a difference, but it didn't. If someone could point me in the direction of a "PDF Tutorial for First Graders", that would be great. I haven't found anything that really seems to start from the very basic building blocks of a PDF file yet.
Thanks,
Jason
Code: Select all
<?php
$pdf = pdf_new();
pdf_open_file($pdf, "test.pdf");
pdf_set_info($pdf, "Author", "Uwe Steinmann");
pdf_set_info($pdf, "Title", "Test for PHP wrapper of PDFlib 2.0");
pdf_set_info($pdf, "Creator", "See Author");
pdf_set_info($pdf, "Subject", "Testing");
pdf_begin_page($pdf, 595, 842);
pdf_add_outline($pdf, "Page 1");
$font = pdf_findfont($pdf, "Times-Roman", "host", 0);
pdf_setfont($pdf, $font, 10);
pdf_set_value($pdf, "textrendering", 1);
pdf_show_xy($pdf, "Times Roman outlined", 50, 750);
pdf_moveto($pdf, 50, 740);
pdf_lineto($pdf, 330, 740);
pdf_stroke($pdf);
pdf_end_page($pdf);
pdf_close($pdf);
//pdf_delete($pdf);
?>Thanks,
Jason