I am trying to generate PDFs using PDFLib for the first time, and have two questions, one of which is very confusing to me.
1) how can I tell the script generating the pdf to store it in a particular place on the computer where the pdf generation is happening?
2) this is the really confusing one. The text being put into the body of the pdf is an article about 6300 characters. The tutorials I have found all follow the same format, and end up printing all of this text in one line (or row), so that the pdf ends up being just one line across. So the question is, how do I get the text to be placed normally on the page, so as to be a readable document? I should add that I am using a block of text sent from an HTML form.
Here is the PHP script:
<?php
$author=$_POST['author'];
$text=$_POST['text'];
$pdf = PDF_new();
PDF_open_file($pdf);
PDF_set_info($pdf, "author", "$author");
PDF_begin_page($pdf,612,792);
$font = PDF_findfont($pdf, "Helvetica", "winansi",0);
PDF_setfont($pdf,$font,12);
PDF_show_xy($pdf, "$text", 5,225);
PDF_end_page($pdf);
PDF_close($pdf);
$buffer = PDF_get_buffer($pdf);
header("Content-type: application/pdf"); header("Content-Length: ".strlen($buffer)); header("Content-Disposition: inline; filename=sample.pdf");
echo $buffer
?>
Thanks! -- Nathan Mealey Director of Operations Cycle-Smart, Inc. P.O. Box 1482 Northampton, MA 01061-1482 [EMAIL PROTECTED] (413) 587-3133 (413) 210-7984 Mobile (512) 681-7043 Fax
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php