I am generating PDFs with TCPDF. I have a test script that generates an inline pdf, as well as a script that saves a PDF to the server and then emails it out.
The PDFs that are saved to file have extremely poor image quality on some images. You can see this below:
The PDFs shown inline (in the browser) have perfect image quality:
Does anyone know why there would be a difference between the two? Same code, just saved differently as per the documentation:
$pdf->Output(self::$base_url.$filename, 'I');
vs
$pdf->Output(self::$base_url.$filename, 'F');
Turns out that the image supplied to me was sent as a .jpg, however the image was actually a .png. I guess TCPDF got confused and hence distorted the image.
I re-saved the image for web as .jpg using Photoshop and all is well.
Soooo.... the client is to blame ;) (For reals, because I was told to use the exact image given).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With