← 返回命令列表

Linux command

pdfimages 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Extract images from PDF

pdfimages [document.pdf] [output_prefix]

Extract as PNG

pdfimages -png [document.pdf] [output_prefix]

Extract as JPEG

pdfimages -j [document.pdf] [output_prefix]

Extract from page range

pdfimages -f [1] -l [5] [document.pdf] [output_prefix]

List images without extracting

pdfimages -list [document.pdf]

Extract preserving original format

pdfimages -all [document.pdf] [output_prefix]

说明

pdfimages extracts images embedded in PDF files. Each image is saved as a separate file with a sequential number. Default output is PPM/PBM format. The -png, -j, and other format options convert to common formats. The -all option preserves original compression when possible. List mode shows image details without extracting: dimensions, color space, compression, and size. This helps understand PDF content before extraction. Page range options limit extraction to specific pages. This is useful for large documents where only certain pages are needed. Images in PDFs may be split across multiple objects or use unusual color spaces. The tool handles these cases transparently. Output files are named with the prefix followed by a sequence number and format extension.

参数

-f _PAGE_
First page to extract from.
-l _PAGE_
Last page to extract from.
-png
Output as PNG.
-tiff
Output as TIFF.
-j
Output as JPEG.
-jp2
Output as JPEG2000.
-jbig2
Output as JBIG2.
-ccitt
Output as CCITT fax.
-all
Write images in their original format when possible.
-list
List images with details without extracting.
-p
Include page numbers in output file names.
-q
Quiet mode, suppress messages and errors.
-opw _PASSWORD_
Owner password for encrypted PDFs.
-upw _PASSWORD_
User password for encrypted PDFs.

FAQ

What is the pdfimages command used for?

pdfimages extracts images embedded in PDF files. Each image is saved as a separate file with a sequential number. Default output is PPM/PBM format. The -png, -j, and other format options convert to common formats. The -all option preserves original compression when possible. List mode shows image details without extracting: dimensions, color space, compression, and size. This helps understand PDF content before extraction. Page range options limit extraction to specific pages. This is useful for large documents where only certain pages are needed. Images in PDFs may be split across multiple objects or use unusual color spaces. The tool handles these cases transparently. Output files are named with the prefix followed by a sequence number and format extension.

How do I run a basic pdfimages example?

Run `pdfimages [document.pdf] [output_prefix]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f _PAGE_ do in pdfimages?

First page to extract from.