Avinash Raut Nagpur(india)
Feb 20 2008, 09:02 AM
QUOTE(FeedBacker @ Dec 12 2007, 04:24 AM)

Question actually.
I have problems at GEN02.Php:
The function PDF_open_image_file (I also tried with PDF_load_image)
Always return 0.
I tried a lot of things (SearchPath, different type of pictures, different pictures...) but still return 0.
Please help!
Tks,
Ferasse.
-Mr. Tea
*******************************************************************
Hello
here is the solution
<?php
$mypdf = PDF_new();
PDF_open_file($mypdf, "");
PDF_begin_page($mypdf, 595, 842);
$myfont = PDF_findfont($mypdf, "Times-Roman", "host", 0);
PDF_setfont($mypdf, $myfont, 10);
//PDF_show_xy($mypdf, "Sample PDF, constructed by PHP in real-time.", 50, 750);
//PDF_show_xy($mypdf, "Made with the PDF libraries for PHP.", 50, 730);
//PDF_show_xy($mypdf, "A JPEG image, on 60 % of its original size.", 50, 710);
//$myimage = PDF_open_image_file($mypdf, "jpeg", "trump.jpg");
$myimage = PDF_load_image($mypdf, "jpeg", "D:\wamp\www\srms_test\pdf\a.jpg", "");
//PDF_place_image($mypdf, $myimage, 50, 650, 0.6);
PDF_fit_image($mypdf, $myimage, 0, 700, "boxsize {200 100} fitmethod meet");
PDF_end_page($mypdf);
PDF_close($mypdf);
$mybuf = PDF_get_buffer($mypdf);
$mylen = strlen($mybuf);
header("Content-type: application/pdf");
header("Content-Length: $mylen");
header("Content-Disposition: inline; filename=gen02.pdf");
print $mybuf;
PDF_delete($mypdf);
?>
Comment/Reply (w/o sign-up)