Jump to content

Trouble with pdf_load_image


ninnypants

Recommended Posts

I'm trying to build a script that will take a list of images and combine them in a pdf but I don't seem to be able to get the images to load correctly for the pdf.

 

pdf_load_image() says that it can take the name of a php file that creates an image, but it keeps failing on me. Can anyone see any errors in my code?

 

[pre]

$pdf = pdf_new();
pdf_open_file($pdf, md5(time()).'.pdf');
$cnt = count($commic_arr);
for($i = 0; $i < $cnt; $i++){
    
    $img = pdf_load_image($pdf, 'auto', 'image.php?com='.$comic_arr[$i], '');
    echo $img;
    $page = pdf_begin_page($pdf, 695, 1100);
    pdf_fit_image($pdf, $img, 0, 0, '');
    pdf_close_image($pdf, $img);
    pdf_end_page($page);
}
pdf_close($pdf);

[/pre]

Link to comment
https://forums.phpfreaks.com/topic/162770-trouble-with-pdf_load_image/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.