note 51677 added to function.pdf-open-image-file

From: Date: Thu, 07 Apr 2005 10:25:20 +0000
Subject: note 51677 added to function.pdf-open-image-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-87638@lists.php.net to get a copy of this message
when using pdf_open_image_file() with multipage tiffs in php 5.x.x I had to use the following $pdf = pdf_new(); pdf_open_file($pdf, "test.pdf"); $file = "mutlipg.tif"; // Important to switch off the exceptions pdf_set_parameter($pdf, "imagewarning", "false"); for($i=1; ; $i++) { $image=@pdf_open_image_file($pdf, "tiff", $file, "page", $i); if($image != 0) { $w = pdf_get_value($pdf, "imagewidth", $image); $h = pdf_get_value($pdf, "imageheight", $image); // use only half of the size pdf_begin_page($pdf, $w/2, $h/2); pdf_place_image($pdf, $image, 0, 0, 0.5); pdf_close_image($pdf, $image); pdf_end_page($pdf); } else break; } // Send the pdf to the Browser pdf_close($pdf); $fp = fopen("test.pdf", "r"); header("Content-type: application/pdf"); fpassthru($fp); fclose($fp); ---- Manual Page -- http://www.php.net/manual/en/function.pdf-open-image-file.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51677 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51677&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51677&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51677&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51677&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51677&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51677&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#87638) next »