Linux command
pdfinfo 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Show PDF information
pdfinfo [document.pdf]
Show detailed metadata
pdfinfo -meta [document.pdf]
Show JavaScript info
pdfinfo -js [document.pdf]
Show structure info
pdfinfo -struct [document.pdf]
Show first page box dimensions
pdfinfo -box [document.pdf]
Show info from encrypted PDF
pdfinfo -upw [password] [document.pdf]
说明
pdfinfo displays metadata and properties of PDF files. It extracts document information without viewing the actual content. Basic info includes title, author, creation date, page count, and dimensions. This helps identify and catalog PDF files. Page box information shows MediaBox, CropBox, and other box dimensions that affect printing and display. Encryption information reveals what permissions are set: printing, copying, modification. It also shows the encryption method. XMP metadata (-meta) contains extended information that applications embed. This may include copyright, keywords, and application-specific data. JavaScript detection (-js) reveals embedded scripts, which may be security concerns in untrusted PDFs.
参数
- -meta
- Show document metadata (XMP).
- -box
- Show page box dimensions.
- -js
- Show JavaScript.
- -struct
- Show structure information.
- -f _PAGE_
- First page for info.
- -l _PAGE_
- Last page for info.
- -enc _ENCODING_
- Text encoding.
- -opw _PASSWORD_
- Owner password.
- -upw _PASSWORD_
- User password.
- -rawdates
- Show raw date strings.
- -isodates
- Show ISO-8601 dates.
FAQ
What is the pdfinfo command used for?
pdfinfo displays metadata and properties of PDF files. It extracts document information without viewing the actual content. Basic info includes title, author, creation date, page count, and dimensions. This helps identify and catalog PDF files. Page box information shows MediaBox, CropBox, and other box dimensions that affect printing and display. Encryption information reveals what permissions are set: printing, copying, modification. It also shows the encryption method. XMP metadata (-meta) contains extended information that applications embed. This may include copyright, keywords, and application-specific data. JavaScript detection (-js) reveals embedded scripts, which may be security concerns in untrusted PDFs.
How do I run a basic pdfinfo example?
Run `pdfinfo [document.pdf]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -meta do in pdfinfo?
Show document metadata (XMP).