Skip to content

STOP ADDING PRS HERE PLEAAAAAASE ! - #1789

Open
Sharcoux wants to merge 279 commits into
Hopding:masterfrom
cantoo-scribe:master
Open

STOP ADDING PRS HERE PLEAAAAAASE !#1789
Sharcoux wants to merge 279 commits into
Hopding:masterfrom
cantoo-scribe:master

Conversation

@Sharcoux

@Sharcoux Sharcoux commented Sep 9, 2026

Copy link
Copy Markdown

We are actively maintaining a fork and had a hard time tracking all the activity through the original and forks of pdf-lib. We also actively worked on the project, but it will be really helpful if you could submit the new PRs directly to @cantoo/pdf-lib.

Hopdings doesn't answer anything and left no maintainer on the project, so we can do nothing except moving to a fork.

Sharcoux and others added 21 commits July 30, 2026 11:51
Handle widgets that carry /FT on page Annots but are missing from
AcroForm.Fields, reusing the existing draw path without mutating
appearances when /AP is absent.

Co-authored-by: Cursor <cursoragent@cursor.com>
Re-sort flat catalog /Names on insert for ISO 32000 compliance, and skip incompatible /Kids trees so existing PDFs are not corrupted.

Co-authored-by: Cursor <cursoragent@cursor.com>
#146)

* fix: recover truncated PDFs instead of throwing on the trailing object

When a PDF is truncated mid-object, parseIndirectObject fails and the
fallback tryToParseInvalidIndirectObject scans forward for `endobj`. On a
truncated file that scan reaches EOF, and the method threw
PDFInvalidObjectParsingError, failing the entire parse.

That throw was only reachable in lenient mode: throwOnInvalidObject already
throws at the top of the same method, so setting it never reached this line.
The error was also never caught anywhere, so a single truncated trailing
object made an otherwise recoverable document unloadable.

The scan loop only exits early on a matched `endobj`, so `failed` can only
mean "hit EOF". Every complete object before it has already been assigned to
the context and maybeRecoverRoot can locate the catalog without an xref, so
the trailing fragment is discarded (warning under warnOnInvalidObjects)
rather than aborting the parse. Strict behaviour via throwOnInvalidObject is
unchanged.

Fixes #63

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WR5mh3JrK5PhdtL7hs6Hfg

* fix: rewind instead of stopping at EOF on an unterminated object

Per review: `this.bytes.moveTo(start); return;` rather than leaving the
cursor at EOF, and drop the extra warning since two already fire above.

Rewinding matters beyond tidiness — an xref section or trailer can follow
the broken object, and leaving the cursor at EOF threw it away. With the
rewind, skipJibberish finds it and the real trailer is parsed instead of
falling back to maybeRecoverRoot(). Covered by a new test asserting
trailerInfo.Size survives, which is undefined without the rewind.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B9zfAyXe6EAH2efuqsXANZ

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Expose get/set APIs for /OCProperties default ON/OFF state so documents can open with selected layers shown or hidden.

Co-authored-by: Cursor <cursoragent@cursor.com>
Make custom-font embedding work cleanly with upstream fontkit/@types/fontkit (collections, optional tables, includeGlyph), and allow picking a collection face via EmbedFontOptions.postscriptName.

Co-authored-by: Cursor <cursoragent@cursor.com>
* uses native crypto over deprecated crypto-js

* adds fresh AES IV, document the RNG requirement
Producers such as iText 2.x store /CF and its filters as refs; lookup
them instead of get so AES/RC4 handlers are found.

Co-authored-by: Cursor <cursoragent@cursor.com>
Publish on v* tags via OIDC; release-it only bumps, tags, and
creates the GitHub release locally.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.