开发者

Print Multiple Content Header Types

I am trying to convert a pdf into an image using Imagick and print multiple pages. The problem I am running into is using the header( "Content-Type: image/jpeg" ); for each page. It will only print the first page. When finished the image is set to a background to a page. M开发者_JAVA百科y code looks like this:

$im = new imagick('filename.pdf');
$im->setImageFormat( "jpg" );

header( "Content-Type: image/jpeg" );
for ($i = 0; $i < $im->getNumberImages(); $i++) {

    $temp_image=new imagick("iptlock_media/files/s8czV4rz4Ge5YMFKsLSu.pdf[$i]");
    $temp_image->setImageFormat( "jpg" );
    echo $temp_image;
}//end foreach

Can anyone please advise how to resolve this issue?


It looks like you are trying to output several jpeg images to one header, which I don't think is possible. Have you considered outputting the images to file and then outputting HTML to display all the images?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜