Extract PDF Page

VerifiedCaution

Extracts a single page from a PDF as a PNG image for quick preview. Uses pdftoppm, sips, or ImageMagick depending on platform.

Sby Skills Guide Bot
DevelopmentBeginner
306/2/2026
Claude Code
#pdf#page-extraction#image-conversion#preview

Recommended for

Our review

Extracts a single page from a PDF as a PNG image for quick preview.

Strengths

  • Fast and lightweight operation without opening the full PDF
  • Automatically falls back to the best available tool (pdftoppm, sips, ImageMagick)
  • Generates a convenient default output filename

Limitations

  • Extracts only one page at a time
  • Depends on external tools being installed (poppler, ImageMagick, or macOS)
  • Does not preserve PDF metadata or layers
When to use it

When you need a quick visual preview of a specific page from a PDF.

When not to use it

To extract multiple pages in batch or convert an entire PDF to images.

Security analysis

Caution
Quality score85/100

The skill uses Bash to run a Python script that calls external tools (pdftoppm, sips, convert). While the intended operation is benign, passing unsanitized user arguments to shell commands could allow injection if the script is not carefully written. The risk is moderate, as no destructive or exfiltrating commands are explicitly instructed, but caution is warranted.

Findings
  • Executes a Python script via Bash with user-supplied file paths and page numbers. If the script does not sanitize inputs, there is a risk of command injection or path traversal.

Examples

Extract page 3
Extract page 3 from report.pdf as a PNG image.
Custom output
Extract page 1 from document.pdf and save it as preview.png.

name: extract-page description: Extract a single page from a PDF as a PNG image for quick preview. argument-hint: <file.pdf> <page-number> allowed-tools: Bash, Read

Extract PDF Page Tool

Use tools/extract_page.py to extract a single page from a PDF as a PNG image.

Usage

Basic usage:

python tools/extract_page.py $ARGUMENTS[0] $ARGUMENTS[1]

With custom output path:

python tools/extract_page.py <file>.pdf <page> -o output.png

Examples

# Extract page 5 from build/lecture.pdf
python tools/extract_page.py build/lecture.pdf 5

# Output will be: build/lecture.page5.png

Notes

  • Page numbers are 1-indexed
  • Default output: <file>.page<N>.png
  • Uses pdftoppm (poppler), sips (macOS), or ImageMagick convert
Related skills