Test cases / pdf

deft pdf meta

Read or set metadata and bookmarks

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

Fixed cases

Generated files, compared with ground truth by tools other than deft.

bookmarks are listedPassed

It must print outline.

deft pdf meta pub17.pdf --json

Input

pub17.pdf 2.9 MB · 142 pages
Page 1Page 2Page 3

Output

No output file. The result is what it printed.

What it printed
{"v":1,"ok":true,"op":"pdf.meta","items":[{"ok":true,"inputs":["pub17.pdf"],"outputs":[],"facts":{"title":"2025 Publication 17","author":"W:CAR:MP:FP","subject":"Your Federal Income Tax, For Individuals","creator":"AH XSL Formatter V6.6 MR4 for Linux64 : 6.6.6.37929 (2019/03/11 12:35JST)","producer":"Antenna House PDF Output Library 6.6.1437 (Linux64); modified using iText 2.1.7 by 1T3XT","created":"D:20260120134746-05'00'","modified":"D:20260120151603Z","outline":[{"level":1,"title":"Contents","page":2},{"level":1,"title":"What’s New","page":3},{"level":1,"title":"Reminders","page":4},{"level":1,"title":"Introduction","page":5},{"level":1,"title":"Part One. The Income Tax Return","page":8},{"level":2,"title":"Chapter 1 Filing Information","page":8},{"level":3,"title":"Introduction","page":8},{"level":3,"title":"Do I Have To File a Return?","page":9},{"level":3,"title":"Form 1040 or 1040-SR","page":10},{"level":3,"title":"File Electronically","page":10},{"level":3,"title":"When Do I Have To File?","page":12},{"level":3,"title":"How Do I Prepare My Return?","page":14},{"level":3,"title":"Where Do I File?","page":18},{"level":3,"title":"What Happens After I File?","page":18},{"level":3,"title":"What if I Made a Mistake?","page":20},{"level":2,"title":"Chapter 2 Filing Status","page":23},{"level":3,"title":"Introduction","page":23},{"level":3,"title":"Marital Status","page":23},{"level":3,"title":"Single","page":24},{"level":3,"title":"Married Filing Jointly","page":24},{"level":3,"title":"Married Filing Separately","page":25},{"level":3,"title":"Head of Household","page":26},{"level":3,"title":"Qualifying Surviving Spouse","page":27},{"level":2,"title":"Chapter 3 Dependents","page":28},{"level":3,"title":"Introduction","page":28},{"level":3,"title":"Dependents","page":28},{"level":3,"title":"Social Security Numbers (SSNs) for Dependents","page":38},{"level":2,"title":"Chapter 4 Tax Withholding and Estimated Tax","page":39},{"level":3,"title":"Introduction","page":39},{"level":3,"title":"Tax Withholding for 2026","page":39},{"level":3,"title":"Estimated Tax for 2026","page":42},{"level":3,"title":"Credit for Withholding and Estimated Tax for 2025","page":46},{"level":3,"title":"Underpayment Penalty for 2025","page":47},{"level":1,"title":"Part Two. Income and Adjustments to Income","page":48},{"level":2,"title":"Chapter 5 Wages, Salaries, and Other Earnings","page":49},{"level":3,"title":"Introduction","page":49},{"level":3,"title":"Employee Compensation","page":49},{"level":3,"title":"Special Rules for Certain Employees","page":53},{"level":3,"title":"Sickness and Injury Benefits","page":55},{"level":2,"title":"Chapter 6 Interest Income","page":56},{"level":3,"title":"Introduction","page":57},{"level":3,"title":"General Information","page":57},{"level":3,"title":"Taxable Interest—General","page":58},{"level":3,"title":"When To Report Interest Income","page":63},{"level":3,"title":"How To Report Interest Income","page":63},{"level":2,"title":"Chapte
… 4447 more characters

Real-file tasks

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

Set the document titlePassed

Set the PDF title of paper.pdf to Trace compilation and save it as titled.pdf.

deft pdf meta paper.pdf --title 'Trace compilation' -o titled.pdf

Input

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

Output

titled.pdf 936.0 KB · 14 pages
Page 1Page 2Page 3
Automatic checks (1)
  • python: code = "import subprocess; o = subprocess.check_output(['gs', '-q', '-dNODISPLAY', '-dNOSAFER', '-c', '(titled.pdf) (r) file runpdfbegin Trailer /Info knownoget { /Title get == } if quit']).decode(); assert 'Trace compilation' in o, o"