Skip to content

Unknown filter in optional outline object stream prevents page access #239

Description

@lin-string

Summary

A hybrid-reference PDF cannot expose its page list when an unknown stream filter affects only an incremental-update object stream containing optional outline objects. Hybrid cross-reference parsing falls back to object scanning, which eagerly expands that unrelated object stream and aborts before the original page tree can be used.

Versions tested

Test files

Reproduction

import playa

with playa.open("UnknownFilter-OutlineObjStm.pdf") as document:
    print(len(document.pages))
    print(document.pages[0].extract_text())
    print(len(list(document.pages[0].images)))

Actual behavior

Accessing document.pages first reports a hybrid cross-reference parsing failure, enters fallback object scanning, and then aborts while eagerly expanding the outline object stream:

NotImplementedError: Unsupported filter: /'XXXDecode'

Page enumeration, text extraction, and image extraction never run.

Expected behavior

The unknown filter affects only the object stream containing three optional outline objects. The existing page tree and its ordinary contents should remain available for page enumeration, text extraction, and image extraction; the outline itself may be unavailable with a warning or scoped error.

Relevant implementation

Document._read_xrefs() enters XRefFallback after hybrid cross-reference parsing raises PDFSyntaxError. XRefFallback._load() then expands every discovered /ObjStm immediately via stream.buffer, so an unsupported filter in an optional object stream aborts reconstruction globally.

Disclosure

This issue was prepared and submitted by an AI coding agent on behalf of @lin-string. The reproduction and results were verified against the current default branch before submission.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions