Retrieves text inside the specified rectangle on the current page.
The rectangle in page coordinates.
Retrieves all text lines on the current page.
Retrieves text for a line returned by [getTextLines].
The text line to extract.
Retrieves all annotations on the current page.
This method fetches all annotations present on the current page of the PDF document and returns a list of corresponding CPDFAnnotation instances.
A promise that resolves with all annotations on the current page, or an empty array if retrieval fails.
Retrieves all form widgets on the current page.
This method fetches all form widgets available on the current page of the PDF document
and returns a list of corresponding CPDFWidget instances.
A promise that resolves to an array of CPDFWidget instances
representing form widgets on the current page. Returns an empty array if retrieval fails.
Rejects with an error if the native view reference is unavailable.
const pageIndex = 0;
const page = pdfReaderRef?.current?._pdfDocument.pageAtIndex(pageIndex);
const widgets = await page?.getWidgets();
Removes an annotation from the current page.
The annotation to be removed.
Removes a form widget from the current page.
The widget to be removed.
A promise that resolves to true when the widget is removed.
Sets the rotation angle of the current page.
The rotation angle in degrees (0, 90, 180, 270). 360 is treated as 0.
A promise that resolves to true when the rotation is applied.
CPDFPage The
CPDFPageclass represents a page in a PDF document. It provides methods to retrieve annotations and form widgets present on the page.Example