Skip to content

v0.1.29: real-world PDFs that open on v0.1.23 now fail (CCITT, annotation appearance, ICCBased, CID font) — reproduced in the official demo #2

Description

@sebgoubier

First, thank you for the work released in v0.1.24 through v0.1.29 — replacing pdf.js/pdf-lib/jszip with the native engine is a big win on my side, and I want to lead with the measurement that made me upgrade:

On a 147 MB dense architectural plan, version v0.1.23 peaked at ~5.5 GB in the hepr-dense-pdf worker and never finished; your demo running v0.1.29 completed the same file at ~2.9 GB. Same bytes, same options, same dense-vector-worker path. Zero runtime dependencies and a 518 KB → 192 KB dense worker are excellent too.

Unfortunately I can't ship the upgrade yet: most of the real drawings I test with open on v0.1.23 and fail on v0.1.29, and all of the failures below reproduce in the official demo (https://soadzoor.github.io/Highly-Efficient-PDF-Renderer), so this isn't something about my integration.

Failures observed on v0.1.29 (all fine on v0.1.23)

Four different documents, four different errors:

1. CCITT Group 4 (scanned drawing)

[hepr] dense PDF fast path fallback: unsupported-content:
XObject /I1 is missing, is an image, or was not validated as a supported Form XObject.

then

CCITT vertical mode places a changing element outside the row.

2. Annotation appearance stream (MEP installation drawing)

Failed to render PDF: Visible /Square annotation 0 has no usable normal appearance;
native synthesis is not implemented.

3. ICC-based colour space (architectural specification exported from Revit)

Failed to render PDF: ICCBased color conversion requires a caller-owned ICC transform resolver.

4. CID font metadata (MEP standardisation document)

Failed to render PDF: CID font /CIDSystemInfo /Ordering must contain printable ASCII.

What they seem to have in common

Each one looks like a construct pdf.js tolerated and the native engine now rejects outright rather than degrading:

  • a CCITT G4 decoder edge case in 2D vertical mode;
  • an annotation with no usable /N appearance stream, where pdf.js synthesises one;
  • an ICCBased colour space with no host-provided transform, where pdf.js falls back to the alternate space or the component count;
  • a /CIDSystemInfo /Ordering string that isn't printable ASCII — malformed by spec, but very common in the wild.

Points 3 and 4 in particular are cases where the spec allows a documented fallback (/Alternate or /N for ICCBased; ignoring a malformed /Ordering), so failing the whole render may be stricter than it needs to be.

Question

Is the intent for these to be hard errors, or would a lenient path be in scope — either a per-feature fallback, or an option like strict: false that degrades (skip the annotation, use the alternate colour space, ignore malformed font metadata) instead of aborting the document?

For anything document-shaped, a page that renders slightly imperfectly is far more useful than a document that won't open at all, and v0.1.23 gave me that behaviour through pdf.js.

Environment

  • @soadzoor/hepr v0.1.29 (regression from v0.1.23)
  • Chrome, Windows 11
  • Reproduced both in my own app and in the official demo, with the same files
  • three.js 0.184, WebGL backend, default options (vectorLod: "auto", textLod: "auto")

Sample files

I'm attaching a reproducer for #1 below. The other three are real drawings I use as test data and don't own, so I'd rather not republish them here — happy to send them privately, or to try to cut them down to minimal reproducers if that's more useful to you.

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