@@ -3256,6 +3256,42 @@ describe("api", function () {
32563256 ] ) ;
32573257 await loadingTask . destroy ( ) ;
32583258 } ) ;
3259+
3260+ it ( "gets editable annotations after getting annotations on page 13" , async function ( ) {
3261+ const loadingTask = getDocument (
3262+ buildGetDocumentParams ( "tracemonkey_with_editable_annotations.pdf" )
3263+ ) ;
3264+ const pdfDoc = await loadingTask . promise ;
3265+ const pdfPage = await pdfDoc . getPage ( 13 ) ;
3266+ await pdfPage . getAnnotations ( ) ;
3267+
3268+ // Get all the editable annotations in the document.
3269+ const editableAnnotations = (
3270+ await pdfDoc . getAnnotationsByType (
3271+ new Set ( [
3272+ AnnotationType . FREETEXT ,
3273+ AnnotationType . STAMP ,
3274+ AnnotationType . INK ,
3275+ AnnotationType . HIGHLIGHT ,
3276+ ] ) ,
3277+ null
3278+ )
3279+ ) . map ( annotation => ( {
3280+ id : annotation . id ,
3281+ subtype : annotation . subtype ,
3282+ pageIndex : annotation . pageIndex ,
3283+ } ) ) ;
3284+ editableAnnotations . sort ( ( a , b ) => a . id . localeCompare ( b . id ) ) ;
3285+ expect ( editableAnnotations ) . toEqual ( [
3286+ { id : "1000R" , subtype : "FreeText" , pageIndex : 12 } ,
3287+ { id : "1001R" , subtype : "Stamp" , pageIndex : 12 } ,
3288+ { id : "1011R" , subtype : "Stamp" , pageIndex : 13 } ,
3289+ { id : "997R" , subtype : "Ink" , pageIndex : 13 } ,
3290+ { id : "998R" , subtype : "Highlight" , pageIndex : 13 } ,
3291+ ] ) ;
3292+
3293+ await loadingTask . destroy ( ) ;
3294+ } ) ;
32593295 } ) ;
32603296 } ) ;
32613297
0 commit comments