A command-line tool for inspecting PDF files. Built with Rust.
- Metadata β Title, author, creator, creation/modification dates (human-readable)
- Page info β Page count and first page dimensions (in cm)
- Color modes β Detects RGB, CMYK, Grayscale, ICC profiles, spot colors
- Embedded fonts β Lists all fonts with type and embedding status
- Print profile β Shows output intents (standard, condition, registry)
- PDF/X-4 compliance β Validates against ISO 15930-7 requirements
curl -fsSL https://raw.githubusercontent.com/necessarylion/pdf-inspect/main/install.sh | bashGo to the Releases page and download the archive for your platform:
| Platform | File |
|---|---|
| Linux (x86_64) | pdf-inspect-x86_64-unknown-linux-gnu.tar.gz |
| Linux (ARM64) | pdf-inspect-aarch64-unknown-linux-gnu.tar.gz |
| macOS (Intel) | pdf-inspect-x86_64-apple-darwin.tar.gz |
| macOS (Apple Silicon) | pdf-inspect-aarch64-apple-darwin.tar.gz |
| Windows (x86_64) | pdf-inspect-x86_64-pc-windows-msvc.zip |
Then extract and move the binary to your PATH:
# macOS / Linux
tar xzf pdf-inspect-*.tar.gz
sudo mv pdf-inspect /usr/local/bin/git clone <repo-url>
cd pdf-inspect
cargo build --releaseThe binary will be at target/release/pdf-inspect.
pdf-inspect document.pdfOutput:
Metadata
Title: My Document
Author: John Doe
CreationDate: 13 March 2026 03:49:34 PM UTC+07:00
Producer: Adobe PDF Library 17.0
Trapped: False
Pages
Count: 12
Size: 21.00 x 29.70 cm
Color Modes
- CMYK
Embedded Fonts
- Arial-BoldMT (TrueType) [embedded]
- TimesNewRomanPSMT (Type1) [embedded]
Print Profile
Standard: GTS_PDFX
Output condition: FOGRA39
Description: Offset commercial and specialty printing
Registry: http://www.color.org
pdf-inspect document.pdf --json
pdf-inspect document.pdf --check-pdfx4 --jsonpdf-inspect document.pdf --check-pdfx4Validates 12 requirements:
| Check | Requirement |
|---|---|
| PDF Version | Must be 1.6 or higher |
| No Encryption | Encryption is prohibited |
| Output Intent | GTS_PDFX must be present |
| Fonts Embedded | All fonts must be embedded |
| TrimBox/ArtBox | Must be present on all pages |
| Color Consistency | No mixing of CMYK and RGB |
| Trapped Key | Must be set to True or False |
| Title | Must be present and non-empty |
| Creator | Must be present and non-empty |
| CreationDate | Must be set |
| ModDate | Must be set |
| GTS_PDFXVersion | Must contain "PDF/X-4" |
# Run during development
cargo run -- document.pdf
cargo run -- document.pdf --json
cargo run -- document.pdf --check-pdfx4 --json
# Build release binary
cargo build --releasesrc/
βββ main.rs # Composition root
βββ domain/
β βββ model.rs # Value objects (PdfReport, ColorMode, Font, etc.)
β βββ repository.rs # PdfRepository trait
βββ infrastructure/
β βββ lopdf_reader.rs # PDF parsing with lopdf
βββ application/
β βββ inspect.rs # Use case + PDF/X-4 validation
βββ presentation/
βββ cli.rs # CLI argument parsing (clap)
βββ formatter.rs # Colored terminal output
- lopdf β PDF parsing
- clap β CLI argument parsing
- serde / serde_json β JSON serialization
MIT