PDF and dynamic PNG
| From: | Dominik Heeb | Date: | Tue, 27 Jan 2004 12:20:35 +0000 |
| Subject: | PDF and dynamic PNG | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-175890@lists.php.net to get a copy of this message | ||
Hello,
I succeed in creating PDF files dynamically with PHP (including inserting
static PNG images), and also succeed in creating PNG images dynamically.
However, I can't insert dynamically created PNG images into PDF files,
neither with pdf_open_image_file, nor with pdf_open_png.
Is this impossible?
D o m i n i k
Example:
function putimage ($pdf, $fullfilename, $x, $y, $width) {
// init
$extension = substr($fullfilename, strrpos ($fullfilename, ".")+1);
$pdfimage = pdf_open_image_file($pdf, $extension, $fullfilename);
// define scale
$sourceimagewidth = pdf_get_value ($pdf, "imagewidth", $pdfimage);
$scale = $width / $sourceimagewidth;
// put image
pdf_place_image($pdf, $pdfimage, $x, $y, $scale);
}