PDFBOX页面转成图像时,如果页面尺寸较小,会产生模糊图像。

huangapple go评论59阅读模式
英文:

PDFBOX page to image produce blurry image if the page dimensions are low

问题

我的任务是将PDF文件转换为图像(通常是PNG),当页面尺寸较低(612,792)时,渲染的图像质量很差,即使使用缩放渲染或DPI API的 "pdfRenderer.renderImage(pageNo, 2)" 也是如此。

使用的版本是20.0.20。

这是使用PDF查看器查看的效果:

同样的代码片段从渲染的图像中看:

在PDF查看器中放大:

放大后的渲染图像如下:

是否有任何方法可以创建更好的图像质量?

谢谢!

英文:

my task is to convert pdf files into images (usually PNG), I encounter situations when the page dimension is low (612,792) the rendered image quality is poor even scale rendering or DPI api's "pdfRenderer.renderImage(pageNo, 2)"

<br><b>20.0.20<b> version is used.
<br>

This is how it looks using <b>pdf viewer</b> :<br>
PDFBOX页面转成图像时,如果页面尺寸较小,会产生模糊图像。

Same snippet from the <b>rendered image</b> :<br>
PDFBOX页面转成图像时,如果页面尺寸较小,会产生模糊图像。

<b>zooming</b> in the pdf viewer :<br>
PDFBOX页面转成图像时,如果页面尺寸较小,会产生模糊图像。

zooming the rendered image result the following :<br>

PDFBOX页面转成图像时,如果页面尺寸较小,会产生模糊图像。

<br><br>
is there any way to create better image quality ??

thanks

答案1

得分: 2

模糊图像问题在2.0.20中已在2020年8月发布的2.0.21中解决。问题已在问题PDFBOX-4863中修复(标题误导,问题不仅与字体有关)。

英文:

The problem of blurry images in 2.0.20 has been solved in 2.0.21, released in August 2020. The problem was fixed in the issue PDFBOX-4863 (the title is misleading, the problem is not just related to fonts).

huangapple
  • 本文由 发表于 2020年7月30日 21:42:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/63174493.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定