From 215eded62e9b8f5b23a8de47a648e0aee7e1a9d9 Mon Sep 17 00:00:00 2001 From: Donald Ness Date: Thu, 13 Jun 2024 13:08:55 -0500 Subject: [PATCH] Hard code 1.7 version header --- src/core/writers/PDFStreamWriter.ts | 3 ++- src/core/writers/PDFWriter.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/writers/PDFStreamWriter.ts b/src/core/writers/PDFStreamWriter.ts index 193ee8c7..6f6bf214 100644 --- a/src/core/writers/PDFStreamWriter.ts +++ b/src/core/writers/PDFStreamWriter.ts @@ -1,3 +1,4 @@ +import PDFHeader from '../document/PDFHeader'; import PDFTrailer from '../document/PDFTrailer'; import PDFInvalidObject from '../objects/PDFInvalidObject'; import PDFName from '../objects/PDFName'; @@ -43,7 +44,7 @@ class PDFStreamWriter extends PDFWriter { protected async computeBufferSize() { let objectNumber = this.context.largestObjectNumber + 1; - const header = this.context.header; + const header = PDFHeader.forVersion(1, 7); let size = header.sizeInBytes() + 2; diff --git a/src/core/writers/PDFWriter.ts b/src/core/writers/PDFWriter.ts index c5604202..69dc45da 100644 --- a/src/core/writers/PDFWriter.ts +++ b/src/core/writers/PDFWriter.ts @@ -115,7 +115,7 @@ class PDFWriter { } protected async computeBufferSize(): Promise { - const header = this.context.header; + const header = PDFHeader.forVersion(1, 7); let size = header.sizeInBytes() + 2;