Skip to content

html2ps / fpdf image quality

You may notice some image issues when using the PHP library html2ps / html2pdf (from http://www.tufat.com/s_html2ps_html2pdf.htm ) or when using some versions of the FPDF library. JPEG quality can be horrible and transparent PNGs do not work.

I found a fix for jpeg image quality, but not yet PNG transparency.

Edit the file /html2ps/output.fpdf.class.php around line 422 there is this code:

imagejpeg($image->get_handle(), $filename);

simply add the quality argument to the imagejpeg function like so:

imagejpeg($image->get_handle(), $filename, 100);

 

Published inWeb Development

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

© dtbaker.net