如何在 Java 中将 PDF 转换为 JPEG?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6818822/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How Can I Convert PDF to JPEG in Java?
提问by redpotato
I have been trying to convert PDFs to images in Java - I tried PDFBox but it actually converts with a pretty bad resolution.
我一直在尝试将 PDF 转换为 Java 中的图像 - 我尝试过 PDFBox,但它实际上以非常糟糕的分辨率进行转换。
Is there any other method that I can use to convert PDFs to images with fine quality?
有没有其他方法可以用来将 PDF 转换为高质量的图像?
If there is an option to do that with PDFBox, could you give me some sample code as well?
如果可以选择使用 PDFBox 执行此操作,您能否也给我一些示例代码?
I have been trying this more than 1 week now...
我已经尝试了 1 个多星期了...
Thanks.
谢谢。
回答by Charles Goodwin
回答by mark stephens
One of the JPedal examples takes advantage of any high resolution images in the PDF to upsample the output for best quality (http://www.jpedal.org/support_egHiRes.php).
JPedal 示例之一利用 PDF 中的任何高分辨率图像对输出进行上采样以获得最佳质量 (http://www.jpedal.org/support_egHiRes.php)。