Hello, i'm having a hard time getting this pos working:
<?php
$pdf = pdf_new();
pdf_open_file($pdf);
// open open first file and read values
$pdi = pdf_open_pdi($pdf, "blar.pdf", "", 0);
$page= pdf_open_pdi_page($pdf, $pdi, 1, "");
$width = pdf_get_pdi_value($pdf, "width", $pdi, $page, 0);
$height = pdf_get_pdi_value($pdf, "height", $pdi, $page, 0);
pdf_begin_page($pdf, $width, $height);
// place page from first file into second file
pdf_fit_pdi_page($pdf, $page, 0, $height, "");
/*
// now add some text
$font = pdf_findfont($pdf, "Courier", "host", 0);
pdf_setfont($pdf, $font, 20);
pdf_show_xy($pdf, "Second page", 200, 350);
*/
pdf_close_pdi_page($pdf, $page);
pdf_end_page($pdf);
pdf_close($pdf);
// display document
$data = pdf_get_buffer($pdf);
header("Content-type: application/pdf");
header("Content-disposition: inline; filename=test.pdf");
header("Content-length: " . strlen($data));
echo $data;
?>
Okay so basically i think its supposed to create a new pdf document, then open an existing one and import it. However it boots up the acrobat plugin but doesnt display anything. Can anyone tell me whats wrong with it?
Thanks in advance
-emrys