{"version":"2.1.202","anchor":"pdf-empty-page-tree-detection","canonical_anchor":"pdf-empty-page-tree-detection","heading":"PDF Empty Page Tree Detection","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.202\/e\/pdf-empty-page-tree-detection","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.202","markdown":"### PDF Empty Page Tree Detection\n\nWhen a PDF attachment reports 0 pages (malformed or empty page tree), Claude Code now emits a specific diagnostic: \"PDF reports 0 pages (empty page tree). The PDF may be invalid.\"\n\n**Details**\n\n- The check runs inside the `pdftoppm`-based PDF-to-image renderer (external `poppler-utils` tool; 120 s timeout, max file size 100 MB)\n- Triggered when `pdftoppm` exits non-zero and its stderr matches `\/Wrong page range given.*last page \\((\\d+)\\)\/i` with a captured page count of exactly `0`\n- The error `reason` field is `\"corrupted\"` \u2014 the same category used for structurally damaged PDFs; the distinct message distinguishes an empty page tree from the generic `\"PDF file is corrupted or invalid.\"` error\n- This check lives inside a cascaded error-classification block that also handles: `password_protected` (stderr contains \"password\"), `page_out_of_range` (same regex but captured count > 0), xref\/trailer syntax errors (`Syntax Error: Couldn't find trailer dictionary \/ read xref table`), and a generic stderr pass-through fallback\n- Pre-conditions enforced before `pdftoppm` is invoked: path must be a regular file, size > 0, size \u2264 100 MB, and `pdftoppm` availability is verified via a cached `-v` probe (5 s timeout); if any precondition fails, a different error reason is returned without reaching this check\n\n**Evidence**\n\nPDF validation (search for `\"PDF reports 0 pages\"` and `\"Wrong page range given\"` inside `NGo()`)"}