Test cases / pdf

deft pdf watermark

Stamp text or an image on pages

3 runs on real files, 13 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.

Watermark with Chinese textPassed

给 f1040.pdf 的每一页加上“机密”两个字的斜向水印,保存为 stamped.pdf。

deft pdf watermark f1040.pdf --text 机密 -o stamped.pdf

Input

f1040.pdf 215.1 KB · 2 pages
Page 1Page 2

Output

stamped.pdf 226.1 KB · 2 pages
Page 1Page 2
Automatic checks (2)
  • pdf_pages: file = "stamped.pdf", pages = 2
  • pdf_changed: file = "stamped.pdf", from = "f1040.pdf", page = 2, min_difference = 0.05

Merge, number and stamp in one goPassed

Combine fw9.pdf and f1040.pdf, number the pages like 1/8, stamp every page with the word DRAFT, and save the result as packet.pdf.

deft pdf merge fw9.pdf f1040.pdf -o a.pdf
deft pdf number a.pdf --format {n}/{total} -o b.pdf
deft pdf watermark b.pdf --text DRAFT -o packet.pdf

Input

f1040.pdf 215.1 KB · 2 pages
Page 1Page 2
fw9.pdf 137.5 KB · 6 pages
Page 1Page 2Page 3

Output

a.pdf 191.3 KB · 8 pages
Page 1Page 2Page 3
b.pdf 204.3 KB · 8 pages
Page 1Page 2Page 3
packet.pdf 217.4 KB · 8 pages
Page 1Page 2Page 3
Automatic checks (3)
  • pdf_pages: file = "packet.pdf", pages = 8
  • pdf_text: file = "packet.pdf", contains = ["1/8", "8/8"], visible = true
  • pdf_changed: file = "packet.pdf", from = "fw9.pdf", page = 2, min_difference = 0.3

Watermark every pagePassed

Add a diagonal CONFIDENTIAL watermark to every page of f1040.pdf and save it as stamped.pdf.

deft pdf watermark f1040.pdf --text CONFIDENTIAL -o stamped.pdf

Input

f1040.pdf 215.1 KB · 2 pages
Page 1Page 2

Output

stamped.pdf 219.3 KB · 2 pages
Page 1Page 2
Automatic checks (3)
  • pdf_pages: file = "stamped.pdf", pages = 2
  • pdf_changed: file = "stamped.pdf", from = "f1040.pdf", page = 1
  • pdf_changed: file = "stamped.pdf", from = "f1040.pdf", page = 2