Forum Moderators: coopster
I'm using the PDFLib functions and just need advice on who has actually worked with these functions.
The reason I am asking is because I have created a PDF on the fly, however I have created just one page, but need to create another page within the PDF, like you press ctrl+enter to create a new page in a word doc.
Here's the code....can anyone help me on this one.
[PHP]
$pdf = pdf_new();
pdf_open_file($pdf);
pdf_set_info($pdf,'Creator','test.php');
pdf_set_info($pdf,'Author','woldie');
pdf_set_info($pdf,'Title','test');
pdf_begin_page($pdf,595,842);
$font = pdf_findfont($pdf,'Helvetica','host',0);
pdf_setfont($pdf,$font,12.0);
// logo placement
$pdfimage = pdf_open_image_file ( $pdf, "jpeg", "logo.jpg");
// $pdfimage = pdf_open_image_file($pdf, "jpeg", "test.jpg");
pdf_place_image($pdf, $pdfimage, 47, 750, 0.6);
$pdfimage = pdf_open_image_file ( $pdf, "jpeg", "sig.jpg");
pdf_place_image($pdf, $pdfimage, 57, 290, 0.6);
$text = "Our Reference:$QuoteNumber";
$todays_date = date("dS of F Y");
$text2 = "Date: $todays_date";
pdf_show_xy($pdf,$text,50,700);
pdf_continue_text($pdf,$text2);
pdf_continue_text($pdf,' ');
pdf_continue_text($pdf,'Dear someone,');
pdf_continue_text($pdf,' ');
pdf_continue_text($pdf,'hello this is a test');
pdf_end_page($pdf);
pdf_set_parameter($pdf,"openaction","fitpage");
pdf_close($pdf);
$buf = pdf_get_buffer($pdf);
$len = strlen($buf);
header('Content-Type: application/pdf');
header("Content-Length: $len");
header('Content-Disposition: inline; filename=test.pdf');
echo $buf;
pdf_delete($pdf);
[/PHP]
Thanks
with FPDF I've been making multi-page documents with no trouble at all.
I haven't used PDFLib as much, but I think you can just call the begin_page method again, and it'll add another page to your document.
PDF_begin_page($pdf, 595, 842);
good luck!