Skip to content

spike(engine): prototype a read-only source-content capability classifier #33

Description

@McanKul

Goal

Prototype a bounded, read-only backend that identifies existing text and image occurrences and explains whether each occurrence could be edited safely.

This is a child deliverable of #11 and must not modify or save a PDF.

Scope

  • Inspect the original source path and source page, not the temporary one-page pagePdf preview copy.
  • Return PDF-space bounds, a stable opaque locator, an element kind, and an explicit capability result.
  • Use reason codes for unsupported cases such as:
    • missing or ambiguous Unicode mapping
    • subset, Type 3, vertical, clipped, patterned, or nested text
    • shared, inline, masked, or nested images
    • encrypted, malformed, signed, or stale source documents
  • Compare a bounded lopdf prototype with a PDFium sidecar prototype.
  • Measure binary size, memory use, cross-platform build/signing cost, and native crash isolation.
  • Keep PDF bytes and engine-native object handles out of React state.

Acceptance criteria

  • The classifier is deterministic on the Spike: evaluate safe editing of existing PDF text and images #11 fixture corpus.
  • Every result is supported or unsupported with a specific reason; there is no silent fallback.
  • Opaque locators are tied to a source fingerprint and fail as stale if the source changes before save.
  • Reused pages and reused XObjects are reported as separate occurrences without implying independent mutability.
  • Parsing and decompression are bounded; malformed input returns a recoverable error.
  • If PDFium is tested, it runs out of process so a native crash cannot terminate the OffPDF UI.
  • The spike ends with a compatibility/performance matrix and a recommendation recorded on Spike: evaluate safe editing of existing PDF text and images #11.

Out of scope

  • Writing a mutation back to the document.
  • Paragraph reflow or a promise to edit every PDF.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: editorPDF editor and document interaction workpriority: highHigh-priority roadmap workspikeTime-boxed technical investigation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions