简体   繁体   中英

DOMPDF Image quality

I would like to know why the quality of my image is low in DOM PDF.

The following image: http://img517.imageshack.us/img517/6996/top3.gif

The borders are 1px and everything looks sharp.

If I include the image in a HTML document with DOMPDF, everything works great, but the quality of the image is not really sharp.

Output: img88.imageshack.us/img88/3801/screenshot20100625at110.png

I'm including it with the following code:

<p><img src="img/pdf/top.gif" /></p>

This could just be a problem with how the PDF is displayed on the screen. If you set your DOMPDF_DPI value to the same as the image, then there should be a one-to-one correspondence between the image dimensions and its dimensions in the document (try a value of 72). I'd wager that unless the zoom level at which you are viewing the PDF is such that the DPI matches exactly between the screen and the PDF that the image will not look quite right since it will need to be scaled.

Your PDF looks like something that is intended to be printed, have you tried printing it out to check the quality? If it doesn't look good you might try adjusting the value of DOMPDF_DPI and/or specifying dimensions of the image.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM