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:
parent
1a69b6ad64
commit
33fdec1392
5 changed files with 38 additions and 3 deletions
|
@ -33,6 +33,8 @@ import { BaseStream } from "./base_stream.js";
|
|||
import { CipherTransformFactory } from "./crypto.js";
|
||||
|
||||
class XRef {
|
||||
#firstXRefStmPos = null;
|
||||
|
||||
constructor(stream, pdfManager) {
|
||||
this.stream = stream;
|
||||
this.pdfManager = pdfManager;
|
||||
|
@ -705,6 +707,7 @@ class XRef {
|
|||
// (possible infinite recursion)
|
||||
this._xrefStms.add(obj);
|
||||
this.startXRefQueue.push(obj);
|
||||
this.#firstXRefStmPos ??= obj;
|
||||
}
|
||||
} else if (Number.isInteger(obj)) {
|
||||
// Parse in-stream XRef
|
||||
|
@ -754,7 +757,10 @@ class XRef {
|
|||
}
|
||||
|
||||
get lastXRefStreamPos() {
|
||||
return this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null;
|
||||
return (
|
||||
this.#firstXRefStmPos ??
|
||||
(this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null)
|
||||
);
|
||||
}
|
||||
|
||||
getEntry(i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue