Note that there are some explanatory texts on larger screens.

plurals
  1. POTCPDF image quality issues
    text
    copied!<p>I'm using a TCPDF to generate PDF documents and I'm trying to add a logo into header, but I have a problem with the image quality and later as I found out, with scaling also.</p> <p>The images inserted into PDF documents with TCPDF suffer from quality losses and size issues. I don't care so much for the size because I can change it, but I can't restore the quality of image.</p> <p>What I have tried:</p> <ul> <li><a href="https://stackoverflow.com/questions/5143132/tcpdf-scaling-and-quality-issue">TCPDF scaling and quality issue</a></li> <li><a href="https://stackoverflow.com/questions/6031329/tcpdf-poor-image-quality">tcpdf: poor image quality</a></li> <li>I have also converted header into HTML code, same quality degradation occurrs.</li> <li>Removed all other options for <code>$pdf-&gt;Image()</code> and left everything in default - image size increased to (presumably) original size with the same quality issues.</li> </ul> <p>This is the code I'm using to insert an image:</p> <pre><code>$this-&gt;Image("../images/logo.jpg", 8, 10, 35, '', 'JPG', '', 'T', false, 0, '', false, false, 0, false, false, false); </code></pre> <p>And this is the beginning of <code>createPDF()</code> function:</p> <pre><code>$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf-&gt;SetCreator('PHP TC-PDF Generator'); $pdf-&gt;SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf-&gt;SetMargins(8, 50, 8); // page margins $pdf-&gt;SetAutoPageBreak(TRUE, 30); $pdf-&gt;setImageScale(1); $pdf-&gt;setFontSubsetting(true); $pdf-&gt;SetFont('helvetica', '', 12, '', true); $pdf-&gt;AddPage(); $pdf-&gt;setTextShadow(array('enabled'=&gt;false)); </code></pre> <p>Any other recommendations?</p> <p>Alternative: I'm willing to change TCPDF with any other PDF generator, if it supports HTML tables and can insert images with better quality.</p> <p>Your help will be greatly appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload