highkite / pdfAnnotate

Javascript library for creating annotations in PDF documents
MIT License
556 stars 90 forks source link

Adding second annotation fails with undefined xref #87

Open adamtlord opened 5 months ago

adamtlord commented 5 months ago

Love this library, brilliant work. For some pdfs (maybe versions > 1.5), I can add one highlight annotation successfully, but adding a second one fails:

TypeError: Cannot read properties of undefined (reading 'compressed')
    at _ObjectUtil.extractObject (object-util.ts:142:46)
    at new CatalogObject (parser.ts:351:35)
    at PDFDocumentParser.getCatalog (parser.ts:761:20)
    at PDFDocumentParser.getPageTree (parser.ts:780:35)
    at PDFDocumentParser.getPage (parser.ts:800:33)
    at _AnnotationFactory.createBaseAnnotation (annotation.ts:192:40)
    at _AnnotationFactory.createHighlightAnnotation (annotation.ts:238:50)
Darpen commented 4 months ago

Hi, have you been able to solve this issue ?