简体   繁体   English

DOMPDF图像质量

[英]DOMPDF Image quality

I would like to know why the quality of my image is low in DOM PDF. 我想知道为什么DOM PDF中图像的质量低。

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

The borders are 1px and everything looks sharp. 边框为1px,一切看起来都很清晰。

If I include the image in a HTML document with DOMPDF, everything works great, but the quality of the image is not really sharp. 如果我将图像包含在带有DOMPDF的HTML文档中,那么一切都很好,但是图像的质量并不是很高。

Output: img88.imageshack.us/img88/3801/screenshot20100625at110.png 输出: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. 这可能只是PDF在屏幕上显示方式的问题。 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). 如果将DOMPDF_DPI值设置为与图像相同,则图像尺寸与其在文档中的尺寸之间应该一一对应(尝试设置为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. 我敢打赌,除非您正在查看PDF的缩放级别足以使DPI在屏幕和PDF之间完全匹配,否则图像将看起来不正确,因为它将需要缩放。

Your PDF looks like something that is intended to be printed, have you tried printing it out to check the quality? 您的PDF看起来像是要打印的东西,您是否尝试过将其打印出来以检查质量? If it doesn't look good you might try adjusting the value of DOMPDF_DPI and/or specifying dimensions of the image. 如果效果不好,则可以尝试调整DOMPDF_DPI的值和/或指定图像的尺寸。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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