1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

[Annotation] Avoid to encrypt the appearance stream two times (bug 1815476)

This commit is contained in:
Calixte Denizet 2023-02-07 19:26:46 +01:00
parent c971f4a0a9
commit ea7b4b4d6c
6 changed files with 34 additions and 19 deletions

View file

@ -45,13 +45,13 @@ function writeDict(dict, buffer, transform) {
}
function writeStream(stream, buffer, transform) {
writeDict(stream.dict, buffer, transform);
buffer.push(" stream\n");
let string = stream.getString();
if (transform !== null) {
string = transform.encryptString(string);
}
buffer.push(string, "\nendstream");
stream.dict.set("Length", string.length);
writeDict(stream.dict, buffer, transform);
buffer.push(" stream\n", string, "\nendstream");
}
function writeArray(array, buffer, transform) {