1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Improve handling of /Filter-entries in writeStream

Fix handling of /Filter-entries, since the current implementation could potentially corrupt the data if there's multiple filters present.
Please note that filters are applied *sequentially* during decoding, starting from the first one in the Array, hence the first Array-entry needs to be /FlateDecode in order for things to actually work correctly.

To prevent a future bug, if we want to save more "complex" data such as images, also ensure that we include any existing /DecodeParms-entries when updating the /Filter-entry.
This commit is contained in:
Jonas Jenwald 2023-06-15 20:48:54 +02:00
parent bd46a934ec
commit 2cb113b545
2 changed files with 33 additions and 25 deletions

View file

@ -1979,7 +1979,7 @@ describe("api", function () {
await loadingTask.destroy();
});
it("write a a new annotation, save the pdf and check that the prev entry in xref stream is correct", async function () {
it("write a new annotation, save the pdf and check that the prev entry in xref stream is correct", async function () {
if (isNodeJS) {
pending("Linked test-cases are not supported in Node.js.");
}