Skip to content

PageObjectBase

@scaryterry/pdfium


Defined in: src/core/types.ts:352

Base interface for page objects.

Page objects represent content elements on a PDF page such as text, images, paths (shapes), shading, and form XObjects. Each object has a type and bounding box.

for (const obj of page.objects()) {
console.log(`${obj.type} at (${obj.bounds.left}, ${obj.bounds.bottom})`);
if (obj instanceof PDFiumTextObject) {
console.log(obj.text, obj.fontSize);
}
}

readonly bounds: Rect

Defined in: src/core/types.ts:356

Bounding box in page coordinates (points, origin at bottom-left).


readonly type: PageObjectType

Defined in: src/core/types.ts:354

The type of this page object.