lional Posted April 17, 2007 Share Posted April 17, 2007 Hi All I am trying to create a pdf image, but the script that I am using seems to enlarge the image, how can I adjust the script, so that it does not alter the image dimensions. function image($file, $x, $y) { if (!isset($this->_images[$file])) { /* First use of requested image, get the extension. */ if (($pos = strrpos($file, '.')) === false) { die(sprintf('Image file %s has no extension and no type was specified', $file)); } $type = strtolower(substr($file, $pos + 1)); /* Check the image type and parse. */ if ($type == 'jpg' || $type == 'jpeg') { $info = $this->_parseJPG($file); } else { die(sprintf('Unsupported image file type: %s', $type)); } /* Set the image object id. */ $info['i'] = count($this->_images) + 1; /* Set image to array. */ $this->_images[$file] = $info; } else { $info = $this->_images[$file]; // Known image, retrieve // from array. } /* If not specified, do automatic width and height * calculations, either setting to original or * proportionally scaling to one or the other given * dimension. */ if (empty($width) && empty($height)) { $width = $info['w']; $height = $info['h']; } elseif (empty($width)) { $width = $height * $info['w'] / $info['h']; } elseif (empty($height)) { $height = $width * $info['h'] / $info['w']; } $this->_out(sprintf('q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q', $width, $height, $x, $this->_h - ($y + $height), $info['i'])); } Any help will be appreciated Thanks Lional Link to comment https://forums.phpfreaks.com/topic/47383-pdf-images/ Share on other sites More sharing options...
lional Posted April 17, 2007 Author Share Posted April 17, 2007 Sorry I forgot to add the script Link to comment https://forums.phpfreaks.com/topic/47383-pdf-images/#findComment-231152 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.