fix(pdf): remove ineffective NewWindow flag from link annotations

Browser PDF viewers control link target behavior, not the PDF spec.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bastien ChanotandClaude Opus 4.6 committed 2026-05-27 05:32:01 +02:00
1 parent d313015950
commit d5e0ec531e
1 file changed
+1 -3
+1 -3
View File
@@ -1,4 +1,4 @@
import { PDFName, PDFArray, PDFBool, PDFString, type PDFPage } from 'pdf-lib'
import { PDFName, PDFArray, PDFString, type PDFPage } from 'pdf-lib'
export interface LinkRect {
x: number
@@ -23,9 +23,7 @@ export function addLinkAnnotation(page: PDFPage, rect: LinkRect): void {
Rect: [rect.x, rect.y, rect.x + rect.width, rect.y + rect.height],
Border: [0, 0, 0],
A: actionDict,
F: 0,
})
annotDict.set(PDFName.of('NewWindow'), PDFBool.True)
const annots = page.node.lookup(PDFName.of('Annots'), PDFArray)
if (annots) {