fix(pdf): bounded attachment extraction by byte scan — no pdf-lib parse on import, export without object streams (BLK-009)

This commit is contained in:
bchanot committed 2026-10-11 16:42:45 +02:00
1 parent 62b8a43e09
commit 60ee71208f
14 files changed
+1054 -198

No files matched your search

+2 -1
View File
@@ -16,11 +16,12 @@ beforeAll(async () => {
sheet = await loadTestSheet()
})
/** Saved like the export (no object streams, BLK-009) so the keyword stamp is in clear. */
async function pdfWithoutAttachment(keywords?: string[]): Promise<Uint8Array> {
const doc = await PDFDocument.create()
doc.addPage()
if (keywords) doc.setKeywords(keywords)
return doc.save()
return doc.save({ useObjectStreams: false })
}
async function rejectsWith(bytes: Uint8Array, kind: string): Promise<void> {