I am generating a pdf with some images in it. Since the images are large in size, the size of the generated PDF will also be very large. Is there a way to dynamically reduce the size of the image while attaching it to the pdf.
I tried something like this from here
`header('Content-Type: image/jpeg');`
`include('SimpleImage.php');`
`$image = new SimpleImage();`
`$image->load($imgPath);`
`$image->resizeToWidth(150);`
`$image->output();`
note1 : $imgPath is passed from a loop and I'm using MPDF to generate the pdf.