Hopding / pdf-lib

Create and modify PDF documents in any JavaScript environment
https://pdf-lib.js.org
MIT License
7.01k stars 676 forks source link

Fix/invalid xref #1696

Closed brandnday closed 2 weeks ago

brandnday commented 2 weeks ago

What?

This PR is to address issue in https://github.com/cantoo-scribe/pdf-lib/issues/64 It is found that there is no problem with the pdf document, but the xref section is corrupted.

Why?

Our team use this library and found this issue when we upload pdf with invalid xref. Turns out this issue raised before

How?

It will precheck if the digits in xref object is valid, if it is not valid, it will just return the empty xref

Testing?

Ran the test locally

New Dependencies?

Screenshots

Suggested Reading?

Anything Else?

Checklist