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.
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.
What I have tried:
- TCPDF scaling and quality issue
- tcpdf: poor image quality
- I have also converted header into HTML code, same quality degradation occurrs.
- Removed all other options for
$pdf->Image()and left everything in default - image size increased to (presumably) original size with the same quality issues.
This is the code I'm using to insert an image:
$this->Image("../images/logo.jpg", 8, 10, 35, '', 'JPG', '', 'T', false, 0, '', false, false, 0, false, false, false);
And this is the beginning of createPDF() function:
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator('PHP TC-PDF Generator');
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(8, 50, 8); // page margins
$pdf->SetAutoPageBreak(TRUE, 30);
$pdf->setImageScale(1);
$pdf->setFontSubsetting(true);
$pdf->SetFont('helvetica', '', 12, '', true);
$pdf->AddPage();
$pdf->setTextShadow(array('enabled'=>false));
Any other recommendations?
Alternative: I'm willing to change TCPDF with any other PDF generator, if it supports HTML tables and can insert images with better quality.
Your help will be greatly appreciated.
