Evals / pdf / Convert a PDF

Render a cover image

Save page 1 of paper.pdf as a 150 dpi image called cover.png.

normalsinglesmokedeft pdf to-images

The task

The reference answer shows the job can be done with deft. It is not an agent run.

deft pdf to-images paper.pdf --pages 1 --dpi 150 -o cover.png

Input

paper.pdf 992.5 KB · 14 pages
Page 1Page 2Page 3

Reference output

cover.png 472.7 KB · 1275x1650
cover.png
How a result is judged (1 check)
  • image: file = "cover.png", width = 1275, height = 1650, format = "PNG"

Runs

CodexWithout deftPassed2026-11-07

Time
16s
New tokens
8.9k
Total input
67.6k
Output tokens
0.5k
Commands
4
Failed
1

Trace

  1. I’ll render only page 1 of `paper.pdf` at 150 dpi and save it as `cover.png` in the current directory.

  2. pwd && rg --files -g 'paper.pdf' -g '"'!**/.git/**'"'
    output
    paper.pdf
  3. python3 -c 'import importlib.util; print(\"fitz\", bool(importlib.util.find_spec(\"fitz\"))); print(\"PIL\", bool(importlib.util.find_spec(\"PIL\")))' && command -v pdftoppm (exit 1)
    output
    fitz False
    PIL True
  4. command -v magick; command -v convert; command -v gs; command -v qlmanage; python3 -c 'import importlib.util; print(\"pdf2image\", bool(importlib.util.find_spec(\"pdf2image\")))'
    output
    /usr/local/bin/gs
    /usr/bin/qlmanage
    pdf2image False
  5. gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r150 -dFirstPage=1 -dLastPage=1 -sOutputFile=cover.png paper.pdf
    output
    GPL Ghostscript 9.55.0 (2021-09-27)
    Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
    This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
    see the file COPYING for details.
    Processing pages 1 through 1.
    Page 1
  6. Saved page 1 of `paper.pdf` at 150 dpi as [cover.png](cover.png).

Output

cover.png 87.3 KB · 1275x1650
cover.png

CodexWith deft, skill installedPassedRead the skillUsed deft2026-11-07

Time
12s
New tokens
4.9k
Total input
57.2k
Output tokens
0.3k
Commands
3
Failed
0

Trace

  1. I’ll use the `deft` file-conversion workflow and save the first page in the current directory as `cover.png` at 150 dpi.

  2. cat .agents/skills/deft/SKILL.md && rg --files -g 'paper.pdf' -g 'AGENTS.md' -g '"'!**/.git/**'"'
    output
    ---
    name: deft
    description: "Use deft instead of writing a script for file jobs: PDF merge/split/compress/watermark, image resize/convert/compress, video and audio trim/convert/compress, spreadsheets, Markdown to PDF/HTML, and YouTube downloads and subtitles."
    ---
    
    # deft
    
    One local command for file jobs. Prefer it over writing Python or shell scripts.
    
    Syntax: `deft <group> <command> [inputs] [-o output] [--options]`
    
    Groups:
    - `pdf`: Merge, split, compress, encrypt, forms, OCR, compare, convert
    - `image`: Resize, crop, convert, compress, filters, montage, OCR
    - `video`: Trim, crop, speed, convert, compress, GIF, frames (ffmpeg)
    - `audio`: Convert, trim, merge, fade, speed, tag, normalize (ffmpeg)
    - `doc`: Word/ODT/RTF: to text, Markdown, HTML, PDF; find and replace
    - `slides`: PowerPoint: extract text, Markdown outline, PDF handout
    - `data`: JSON/YAML/TOML/XML: convert, query with jq syntax, merge, diff
    - `sheet`: Excel/CSV/ODS tables: filter, sort, join, pivot, convert
    - `md`: Markdown to PDF, HTML, Word, EPUB; table of contents
    - `html`: HTML to Markdown, text, Word, PDF; screenshots
    - `epub`: E-books: info, to text, Markdown and PDF
    - `email`: EML files: headers, text, attachments
    - `contact`: VCF address books: to and from CSV
    - `calendar`: ICS calendars: to and from CSV
    - `gps`: GPX and KML tracks: convert, distance and time
    - `youtube`: Info, download, audio, subtitles, thumbnail (yt-dlp)
    - `file`: Any file: hash, duplicates, batch rename, base64, encoding
    - `qr`: Cre
    … 738 more characters
  3. deft pdf --help
    output
    deft pdf - commands (input -> output)
      info            pdf -> report       Pages, size, metadata, fonts, images
      compare         pdf... -> report    Compare two PDFs: text and pixels
      compress        pdf -> pdf          Make smaller: --level, --target-size 2MB
      crop            pdf -> pdf          Trim pages: --margin, --box, --auto
      decrypt         pdf -> pdf          Remove a password you know
      delete          pdf -> pdf          Remove pages: --pages 2,5-7
      encrypt         pdf -> pdf          Protect with a password (AES-256)
      extract-images  pdf -> image...     Save embedded pictures, unchanged
      extract-sheets  pdf -> csv|xlsx...  Save each table apart [beta]
      fields          pdf -> report       List form fields
      fill            pdf -> pdf          Fill a form from JSON: --data values.json
      flatten         pdf -> pdf          Bake forms into pages
      from-images     image... -> pdf     One page per image
      from-md         md -> pdf           Typeset Markdown as PDF
      grayscale       pdf -> pdf          Remove colour (Ghostscript)
      merge           pdf... -> pdf       Join PDFs in the given order
      meta            pdf -> pdf          Read or set metadata and bookmarks
      number          pdf -> pdf          Add page numbers: --format
      ocr             pdf -> pdf|txt      Make a scan searchable
      redact          pdf -> pdf          Black out for good: --box or --text
      repair          pdf -> pdf          Rebuild a damaged PDF (Ghostscript)
      resize          pdf -> p
    … 892 more characters
  4. deft pdf to-images --help && deft pdf to-images paper.pdf -o cover.png --pages 1 --dpi 150
    output
    deft pdf to-images - Render pages: --dpi, --pages
    Same as: deft convert
    
    Usage: deft pdf to-images <pdf>... [-o <dir>] [options]
    In: pdf (each handled separately)   Out: png|jpg files in <name>-images/
    
    Options:
      --to <png|jpg>               Image format (default png)
      --dpi <n>                    Resolution (default 150)
      --quality <n>                JPEG quality (default 85)
      --pages <pages>              Pages to render (default all)
      --password <text>            Password of an encrypted input
    Common: -o --force --dry-run --json -j   (deft help common)
    
    Examples:
      deft pdf to-images three-pages.pdf -o pages/
      deft pdf to-images report.pdf --pages 1 --to jpg --dpi 300 -o cover/
    
    Result fields: files
    ok pdf.to-images paper.pdf -> cover.png  1 image  0.26s
  5. Saved page 1 of `paper.pdf` as [cover.png](cover.png) at 150 dpi.

Output

cover.png 472.7 KB · 1275x1650
cover.png

CodexWith deft, skill as AGENTS.mdPassed2026-11-05

Time
12s
New tokens
6.0k
Total input
77.2k
Output tokens
0.3k
Commands
4
Failed
0

Trace

  1. I’ll check the available `deft` PDF options, then export page 1 at 150 dpi to `cover.png` in the current directory.

  2. deft pdf
    output
    deft pdf - commands (input -> output)
      info         pdf -> report      Pages, size, metadata, fonts, images
      compress     pdf -> pdf         Make a PDF smaller: --level, --target-size 2MB
      delete       pdf -> pdf         Remove pages: --pages 2,5-7
      from-images  image... -> pdf    One page per image, in the given order
      from-md      md -> pdf          Typeset a PDF with headings, tables, code, images
      merge        pdf... -> pdf      Join PDFs in the given order
      number       pdf -> pdf         Add page numbers: --format "{n} of {total}"
      rotate       pdf -> pdf         Turn pages clockwise: --angle 90, --pages
      select       pdf -> pdf         Keep and reorder pages: --pages 3,1-2
      split        pdf -> pdf...      One file per page, or --every N, --ranges 1-3,4-
      to-images    pdf -> png|jpg...  Render pages to images: --dpi, --pages
      to-text      pdf -> txt         Extract text (form feed between pages)
      watermark    pdf -> pdf         Stamp text or an image on pages: --text, --image
    More: deft pdf <command> --help
  3. deft pdf to-images --help
    output
    deft pdf to-images - Render pages to images: --dpi, --pages
    Same as: deft convert
    
    Usage: deft pdf to-images <pdf>... [-o <dir>] [options]
    In: pdf (each handled separately)   Out: png|jpg files in <name>-images/
    
    Options:
      --to <png|jpg>               Image format (default png)
      --dpi <n>                    Resolution (default 150)
      --quality <n>                JPEG quality (default 85)
      --pages <pages>              Pages to render (default all)
      --password <text>            Password of an encrypted input
    Common: -o --force --dry-run --json -j   (deft help common)
    
    Examples:
      deft pdf to-images three-pages.pdf -o pages/
      deft pdf to-images report.pdf --pages 1 --to jpg --dpi 300 -o cover/
    
    Result fields: files
  4. The PDF command writes page images into an output directory. I’ll render page 1 there, then place the resulting image at `cover.png`.

  5. deft pdf to-images paper.pdf --pages 1 --dpi 150 -o cover-render
    output
    ok pdf.to-images paper.pdf -> cover-render/paper-001.png  1 image  0.26s
  6. mv cover-render/paper-001.png cover.png && rmdir cover-render && ls -l cover.png
    output
    -rw-r--r--@ 1 user  staff  483999 Nov  4 19:58 cover.png
  7. Saved page 1 of `paper.pdf` at 150 dpi as [cover.png](cover.png).

Output

Its files were not kept in this run. The last line of the trace is its own report.

Claude Opus 5.5Without deftPassed2026-11-07

Time
9s
New tokens
8.6k
Total input
42.0k
Output tokens
0.4k
Commands
0
Failed
0

Trace

    Output

    cover.png 87.3 KB · 1275x1650
    cover.png

    Claude Opus 5.5With deft, skill installedPassedRead the skillUsed deft2026-11-07

    Time
    15s
    New tokens
    11.2k
    Total input
    77.4k
    Output tokens
    0.6k
    Commands
    0
    Failed
    0

    Trace

      Output

      ---
      name: deft
      description: "Use deft first for any simple, direct operation on local files, whatever the type: convert, read, extract, edit, compress, merge, split, compare or inspect. Try it before writing a script or one-liner. If unsure, run deft find; if it says no command does this, use another tool. Not for programming work: to read, write or change source code, skip it."
      ---
      
      # deft
      
      One local command for file jobs. Prefer it over writing Python or shell scripts.
      
      Syntax: `deft <group> <command> [inputs] [-o output] [--options]`
      
      Groups:
      - `pdf`: Merge, split, compress, encrypt, forms, OCR, compare, convert
      - `image`: Resize, crop, convert, compress, adjust, montage, OCR
      - `video`: Trim, merge, convert, compress, subtitles, GIF, frames (ffmpeg)
      - `audio`: Convert, trim, normalize, denoise, cut silence (ffmpeg)
      - `doc`: Word/ODT/RTF: to text, Markdown, HTML, PDF; find and replace
      - `slides`: PowerPoint: extract text, Markdown outline
      - `sheet`: Excel/CSV/ODS tables: SQL query, pivot, merge, split, convert
      - `json`: JSON: convert, format, merge, diff, validate
      - `toml`: TOML: convert, format, merge, diff, validate
      - `xml`: XML: convert, format, merge, diff, validate
      - `yaml`: YAML: convert, format, merge, diff, validate
      - `md`: Markdown to PDF, HTML, Word, EPUB; table of contents
      - `html`: HTML to Markdown, text, Word and PDF
      - `epub`: E-books: info, to text, Markdown and PDF
      - `gps`: GPX and KML tracks: convert, distance and time
      - `qr`: Create QR codes and barcodes; read QR codes
      
      How to use it:
      1. Run `deft <group>` to list commands, or `deft find "<what you want>"` to search. If it says `no command does this`, use another tool.
      2. Run `deft <group> <command> --help` for options and examples.
      3. `deft convert <in> -o <out.ext>` converts between formats by extension.
      4. Results are one line starting with `ok`, `partial` or `error`; add `--json` to parse them. Errors include a `hint:` with the fix.
      
      Inputs are never overwritten; pass `--force` or `--in-place` to allow it. Globs and directories work as inputs; several inputs run in parallel.
      
      If `deft` is not installed, ask the user, then follow https://github.com/firstprayer/deft/blob/main/docs/INSTALL.md
      
      cover.png 472.7 KB · 1275x1650
      cover.png

      Claude CodeWithout deftNot run yet

      Claude CodeWith deftNot run yet