1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Don't replace Acroform dictionary if nothing has changed when saving (bug 1844572)

This commit is contained in:
Calixte Denizet 2023-07-20 17:05:52 +02:00
parent 1a69b6ad64
commit 33fdec1392
5 changed files with 38 additions and 3 deletions

View file

@ -544,6 +544,7 @@ class WorkerMessageHandler {
pdfManager.ensureCatalog("acroForm"),
pdfManager.ensureCatalog("acroFormRef"),
pdfManager.ensureDoc("startXRef"),
pdfManager.ensureDoc("linearization"),
];
const newAnnotationsByPage = !isPureXfa
@ -595,6 +596,7 @@ class WorkerMessageHandler {
acroForm,
acroFormRef,
startXRef,
linearization,
...refs
]) {
let newRefs = [];
@ -656,7 +658,9 @@ class WorkerMessageHandler {
infoRef: xref.trailer.getRaw("Info") || null,
info: infoObj,
fileIds: xref.trailer.get("ID") || null,
startXRef: xref.lastXRefStreamPos ?? startXRef,
startXRef: linearization
? startXRef
: xref.lastXRefStreamPos ?? startXRef,
filename,
};
}