Tcpdf Rendering images of different dimensions in a pdf (using PHP)
Get the solution ↓↓↓I am fetching dynamic logo images from a URL from our client and have to place the image at a specific space in pdf (Using TCPDF). I need to preserve the aspect ratio of the image and also the image should not overlap or go beyond the space allotted for the image in the pdf. As of now I have given width as 0 and height as 10 in the Image function so that it will auto calculate the width.
$this->Image($imagefromUrl,12, 270, 0, 10, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false, $alt=false, $altimgs=array());
But the above approach is not working for all the images since for some images width is larger and for some images height is larger. For example image with "2671x350" dimensions , there is no control over the image width its just overlaps the other context in the pdf. Can some help me to understand and place images in the pdf preserving the aspect ratio of the image? thanks
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: the process class relies on proc_open, which is not available on your php installation.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.