@@ -2167,6 +2167,65 @@ describe("api", function () {
21672167 await loadingTask . destroy ( ) ;
21682168 } ) ;
21692169
2170+ it ( "gets outline, with SE (Structure Element) entries" , async function ( ) {
2171+ const loadingTask = getDocument (
2172+ buildGetDocumentParams ( "outlines_se.pdf" )
2173+ ) ;
2174+ const pdfDoc = await loadingTask . promise ;
2175+ const outline = await pdfDoc . getOutline ( ) ;
2176+
2177+ expect ( outline ) . toEqual ( [
2178+ {
2179+ action : null ,
2180+ attachment : undefined ,
2181+ dest : null ,
2182+ url : null ,
2183+ unsafeUrl : undefined ,
2184+ newWindow : undefined ,
2185+ setOCGState : undefined ,
2186+ title : "P tags" ,
2187+ color : new Uint8ClampedArray ( [ 0 , 0 , 0 ] ) ,
2188+ count : 2 ,
2189+ bold : false ,
2190+ italic : false ,
2191+ items : [
2192+ {
2193+ action : null ,
2194+ attachment : undefined ,
2195+ dest : [ { num : 37 , gen : 0 } , { name : "XYZ" } , null , null , null ] ,
2196+ url : null ,
2197+ unsafeUrl : undefined ,
2198+ newWindow : undefined ,
2199+ setOCGState : undefined ,
2200+ title : "Hello " ,
2201+ color : new Uint8ClampedArray ( [ 0 , 0 , 0 ] ) ,
2202+ count : undefined ,
2203+ bold : false ,
2204+ italic : false ,
2205+ items : [ ] ,
2206+ } ,
2207+ {
2208+ action : null ,
2209+ attachment : undefined ,
2210+ dest : [ { num : 36 , gen : 0 } , { name : "XYZ" } , null , null , null ] ,
2211+ url : null ,
2212+ unsafeUrl : undefined ,
2213+ newWindow : undefined ,
2214+ setOCGState : undefined ,
2215+ title : "World " ,
2216+ color : new Uint8ClampedArray ( [ 0 , 0 , 0 ] ) ,
2217+ count : undefined ,
2218+ bold : false ,
2219+ italic : false ,
2220+ items : [ ] ,
2221+ } ,
2222+ ] ,
2223+ } ,
2224+ ] ) ;
2225+
2226+ await loadingTask . destroy ( ) ;
2227+ } ) ;
2228+
21702229 it ( "gets non-existent permissions" , async function ( ) {
21712230 const permissions = await pdfDocument . getPermissions ( ) ;
21722231 expect ( permissions ) . toEqual ( null ) ;
0 commit comments