Test cases / pdf

deft pdf encrypt

Protect with a password (AES-256)

2 runs on real files, 8 tests on generated files, not shown. 0 failed.

Real-file tasks

Real files and a plain-language job, from the agent benchmark. These are the reference answers, not an agent run.

Password-protect a PDFPassed

Protect paper.pdf with the password hunter2 and save it as paper-locked.pdf.

deft pdf encrypt paper.pdf --new-password hunter2 -o paper-locked.pdf

Input

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

Output

This PDF has no preview: it needs a password or cannot be read.

Automatic checks (2)
  • pdf_encrypted: file = "paper-locked.pdf", encrypted = true
  • pdf_pages: file = "paper-locked.pdf", pages = 14, password = "hunter2"

Send a scan to an accountantPassed

scan.pdf is going to our accountant. Make the text searchable, keep it under 1MB, and protect it with the password hunter2. Save it as for-accountant.pdf.

deft pdf ocr scan.pdf -o searchable.pdf
deft pdf compress searchable.pdf --target-size 1MB -o small.pdf
deft pdf encrypt small.pdf --new-password hunter2 -o for-accountant.pdf

Input

scan.pdf 1.8 MB · 4 pages
Page 1Page 2Page 3

Output

This PDF has no preview: it needs a password or cannot be read.

searchable.pdf 1.9 MB · 4 pages
Page 1Page 2Page 3
small.pdf 453.0 KB · 4 pages
Page 1Page 2Page 3
Automatic checks (3)
  • max_bytes: file = "for-accountant.pdf", bytes = 1048576
  • pdf_encrypted: file = "for-accountant.pdf", encrypted = true
  • pdf_text: file = "for-accountant.pdf", password = "hunter2", contains = ["CORONA"]