如何使用Java从pdf中提取图像(不使用pdfbox) [英] How to extract images from pdf using Java (not using pdfbox)

查看:759
本文介绍了如何使用Java从pdf中提取图像(不使用pdfbox)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究如何从一个大的(> 300MB)PDF文件中提取图像。我正在使用pdfbox,但由于某些特殊原因,我无法弄清楚,有些页面未正确提取。

I've being researching on how to extract images from a big (> 300MB) PDF file. I'm using pdfbox but for some particular reason that I can't figure out, some pages are not correctly extracted.

我正在使用pdfbox的PDFToImage类作为我的代码基础。

I'm using the PDFToImage class of pdfbox as base for my code.

那么,你知道另一个可以帮助我做这个的库吗?我知道可以使用iText,但我读到它不能用于商业产品。

So, do you know another library that may help me to do this? I know that iText may be used, but I read that it can't be used for commercial products.

我已经安装了软件包xpdf和xpdf-utils,以及名为pdfimages的实用工具非常完美。但我需要从Java解决这个问题,它应该是可移植的。

I've installed the packages xpdf and xpdf-utils, and the utility called pdfimages is working perfect. But I need to solve this problem from Java and it should be portable.

推荐答案

我认为你在谈论两件不同的事情这里:从PDF中提取图像,并将PDF页面转换为图像。 PDFToImage 将为每个页面输出图像,而pdfimages将提取所有嵌入的图像(例如,文本文档有0个图像)。

I think you're talking about two different things here: extracting images from a PDF, and converting PDF pages to images. PDFToImage will output an image for every page, while pdfimages extracts all embedded images (e.g. a text document has 0 images).

查看 org.apache。 pdfbox.ExtractImages 查看它是否符合您的要求。

Take a look at org.apache.pdfbox.ExtractImages to see if it does what you want.

这篇关于如何使用Java从pdf中提取图像(不使用pdfbox)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆