Bug #12021 Updated: Problem with the data parameter in pdf_open_image()
| From: | sniper@php.net | Date: | Mon, 08 Oct 2001 22:47:24 +0000 |
| Subject: | Bug #12021 Updated: Problem with the data parameter in pdf_open_image() | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-67575@lists.php.net to get a copy of this message | ||
ID: 12021
Updated by: sniper
Reported By: fred@surleau.com
Old Status: Feedback
Status: Closed
Bug Type: PDF related
Operating System: Win NT 4.0
PHP Version: 4.0.6
Previous Comments:
------------------------------------------------------------------------
[2001-07-10 12:50:56] fred@surleau.com
Hi,
I use PDFLIB version 4.0.1 and PHP 4.0.6.
<?
$file = "image.jpg";
$len=filesize($file);
$fp = fopen($file, "rb");
echo $fp;
$data = fread($fp, $len);
fclose($fp);
$pdf=pdf_new();
pdf_open_file($pdf, "test.pdf");
pdf_begin_page($pdf, 595, 842);
// With pdf_open_image_file() it works !
// $pim = pdf_open_image_file($pdf, "jpeg", $file");
$pim = pdf_open_image($pdf, "jpeg", "memory", $data, $len, 300, 100, 3, 8,
"" );
PDF_place_image($pdf, $pim, 100, 500, 1);
PDF_close_image($pdf, $pim);
pdf_end_page($pdf);
pdf_close($pdf);
?>
The script works with no errors, and the PDF file is created.
With pdf_open_image_file() the Jpeg file is correctly mixed in the PDF file
With pdf_open_image(), at the place in the PDF file where I should find the Jpeg data, there is
garbage starting with "C:\inetpub\wwwroot" !
I need to use pdf_open_image() instead of pdf_open_image_file() because the image I want to use is
not a file, it's created with the gd library, and the function pdf_open_memory_image() is not
available in PHP 4.0.6 binaries for Win32.
Regards.
Fred.
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=12021&edit=1