且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从PDF文件提取图像?

更新时间:2023-12-05 15:32:10

pdfimages 就是这样.它是poppler-utils和xpdf-utils软件包的一部分.

pdfimages does just that. It's is part of the poppler-utils and xpdf-utils packages.

从联机帮助页:

Pdfimages将可移植文档格式(PDF)文件中的图像另存为可移植Pixmap(PPM),可移植位图(PBM)或JPEG文件.

Pdfimages saves images from a Portable Document Format (PDF) file as Portable Pixmap (PPM), Portable Bitmap (PBM), or JPEG files.

Pdfimages读取PDF文件,扫描一页或多页PDF文件并为每个图像image-root-nnn.xxx写入一个PPM,PBM或JPEG文件,其中nnn是图像编号,xxx是图像类型(.ppm,.pbm,.jpg).

Pdfimages reads the PDF file, scans one or more pages, PDF-file, and writes one PPM, PBM, or JPEG file for each image, image-root-nnn.xxx, where nnn is the image number and xxx is the image type (.ppm, .pbm, .jpg).

注意:pdfimages从PDF文件中提取原始图像数据,而无需执行任何其他转换. PDF内容流所做的任何旋转,剪切,颜色反转等操作都将被忽略.

NB: pdfimages extracts the raw image data from the PDF file, without performing any additional transforms. Any rotation, clipping, color inversion, etc. done by the PDF content stream is ignored.