tcpdf: poor image quality

后端 未结 4 385
既然无缘
既然无缘 2021-01-17 13:40

I am using TCPDF to create PDF files converted from HTML input using it\'s writeHTML() function. However, images within the PDF have poor quality, while the original images

相关标签:
4条回答
  • 2021-01-17 13:49

    Try To convert your Image to JPG or JPEG first. Until Now, I DOnt have a problem to convert image with TCPDF. I Think TCPDF is powerfull, because it can convert arabic language too. I HAve try convert arabic font with fpdf n it still fail

    0 讨论(0)
  • 2021-01-17 13:53

    When using HTML to generate your PDFs you need to manually calculate the images dimensions by dividing it's original width and height by 1.53 and set the result as attributes.

    For example, an image with dimensions of 200x100 pixels will become:

    <img src="image.jpg" width="131" height="65" />
    

    This is a nasty workaround and doesn't completely remove the blur, but the result is much better than without any scaling.

    0 讨论(0)
  • 2021-01-17 13:54

    Try using this:

    $pdf->setImageScale(1.53); 
    

    http://sourceforge.net/projects/tcpdf/forums/forum/435311/topic/4831671

    0 讨论(0)
  • 2021-01-17 13:59

    Little Up.

    I'd same quality problem and I solved it... When you save your picture, do it in 8bits instead of 24bits and you will see a "beautiful anti-aliasing".

    0 讨论(0)
提交回复
热议问题