Skip to content

Commit

Permalink
Fix issue that was causing Adobe Acrobat to throw an error
Browse files Browse the repository at this point in the history
Affected encrypted PDFs
  • Loading branch information
programmarchy authored and Sharcoux committed Jun 25, 2024
1 parent 215eded commit 07dae97
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/writers/PDFStreamWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import PDFNumber from '../objects/PDFNumber';
import PDFObject from '../objects/PDFObject';
import PDFRef from '../objects/PDFRef';
import PDFStream from '../objects/PDFStream';
import PDFCatalog from '../structures/PDFCatalog';
import PDFPageTree from '../structures/PDFPageTree';
import PDFPageLeaf from '../structures/PDFPageLeaf';
import PDFContext from '../PDFContext';
import PDFCrossRefStream from '../structures/PDFCrossRefStream';
import PDFObjectStream from '../structures/PDFObjectStream';
Expand Down Expand Up @@ -68,6 +71,9 @@ class PDFStreamWriter extends PDFWriter {
ref === this.context.trailerInfo.Encrypt ||
object instanceof PDFStream ||
object instanceof PDFInvalidObject ||
object instanceof PDFCatalog ||
object instanceof PDFPageTree ||
object instanceof PDFPageLeaf ||
ref.generationNumber !== 0;

if (shouldNotCompress) {
Expand Down

0 comments on commit 07dae97

Please sign in to comment.