Hi everyone - I have a kinda noob question about pdf, so grateful for anyone who can stick with me on this
I have just a jpg file, and some text, and I'm trying to output a PDF, with the jpg, followed by the text.
So far I have:
<?php
$pdf = pdf_new();
pdf_open_file($pdf);
pdf_set_info($pdf, "Author", "Me");
pdf_begin_page($pdf, (72 * 11.69291), (72 * 8.267717)); //Something approaching A4
$font = pdf_findfont($pdf, "Courier", "host", 0);
pdf_setfont($pdf, $font, 16);
$image = pdf_open_image_file($pdf,"jpeg","test.jpg");
pdf_place_image($pdf,$image,64,46,1);
pdf_set_text_pos($pdf, 50, 20);
$MyText = 'This is a text file which will be a few pages long';
pdf_show($pdf, $MyText);
pdf_end_page($pdf);
pdf_close($pdf);
$document = pdf_get_buffer($pdf);
$length = strlen($document);
$filename = "myfirstpdf.pdf";
header("Content-Type: application/pdf");
header("Content-Length: " . $length);
header("Content-Disposition: inline; filename=" . $filename);
echo($document);
unset($document);
pdf_delete($pdf);
?>
All I need to do is make the text go on after the image, and to wrap and flow onto new pages.
I'm running PHP Version 4.4.7 and PDFlib GmbH Version 3.02.
Simple pointers gratefully received!