MCPcopy Create free account
hub / github.com/LibPDF-js/core / getPage

Method getPage

src/api/pdf.ts:1591–1605  ·  view source on GitHub ↗

* Get a single page by index (0-based). * Returns null if index out of bounds.

(index: number)

Source from the content-addressed store, hash-verified

1589 * Returns null if index out of bounds.
1590 */
1591 getPage(index: number): PDFPage | null {
1592 const ref = this.ctx.pages.getPage(index);
1593
1594 if (!ref) {
1595 return null;
1596 }
1597
1598 const dict = this.ctx.resolve(ref);
1599
1600 if (!(dict instanceof PdfDict)) {
1601 return null;
1602 }
1603
1604 return new PDFPage(ref, dict, index, this.ctx);
1605 }
1606
1607 // ─────────────────────────────────────────────────────────────────────────────
1608 // Page manipulation

Callers 15

PageFunction · 0.45
generateMetadataFunction · 0.45
GETFunction · 0.45
GETFunction · 0.45
signing.test.tsFile · 0.45
drawing.test.tsFile · 0.45
layers.test.tsFile · 0.45

Calls 1

resolveMethod · 0.45

Tested by 1

loadTaggedFormFunction · 0.36