* Get all pages in document order.
()
| 1560 | * Get all pages in document order. |
| 1561 | */ |
| 1562 | getPages(): PDFPage[] { |
| 1563 | const refs = this.ctx.pages.getPages(); |
| 1564 | const pages: PDFPage[] = []; |
| 1565 | |
| 1566 | for (let i = 0; i < refs.length; i++) { |
| 1567 | const ref = refs[i]; |
| 1568 | const dict = this.ctx.resolve(ref); |
| 1569 | |
| 1570 | if (!(dict instanceof PdfDict)) { |
| 1571 | throw new Error(`Page ${i} is not a dictionary`); |
| 1572 | } |
| 1573 | |
| 1574 | pages.push(new PDFPage(ref, dict, i, this.ctx)); |
| 1575 | } |
| 1576 | |
| 1577 | return pages; |
| 1578 | } |
| 1579 | |
| 1580 | /** |
| 1581 | * Get page count. |
no test coverage detected