Itext7:将PDF页面渲染为图像 [英] Itext7: render PDF page to image
问题描述
我可以使用IText 7将PDF页面渲染为真实图像对象(例如BufferedImage)吗?
Can I render a PDF Page to a real image object (e.g. BufferedImage) using IText 7?
推荐答案
如果你真的想要这样做,请考虑使用GhostScript。
If you really want to do this, consider using GhostScript.
Ghostscript是一套基于Adobe
Systems'PostScript解释器的软件和可移植文档格式(PDF)页面
描述语言。其主要用途是光栅化或
渲染此类页面描述语言文件,用于显示或
打印文档页面,以及PostScript和
PDF文件之间的转换。 - 维基百科
Ghostscript is a suite of software based on an interpreter for Adobe Systems' PostScript and Portable Document Format (PDF) page description languages. Its main purposes are the rasterization or rendering of such page description language files, for the display or printing of document pages, and the conversion between PostScript and PDF files. -- wikipedia
正如Bruno所说,iText通常不会进入渲染域。
As Bruno said, iText generally does not go into the rendering domain.
但是,请记住,您希望在完成此文档后使用此文档的人员正在创建什么样的情况。文本提取将不再有效(除非您进行OCR),您将丢失任何搜索功能或元信息等。
However, keep in mind what kind of a situation you're creating for the people who wish to use this "document" after you're done with it. Text-extraction will no longer work (unless you OCR it), you lose any search functionality or meta-information, etc.
这篇关于Itext7:将PDF页面渲染为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!