pub struct PdfPage<'a> { /* private fields */ }
Expand description

A single page in a PdfDocument.

In addition to its own intrinsic properties, a PdfPage serves as the entry point to all object collections related to a single page in a document. These collections include:

Implementations

Returns the label assigned to this PdfPage, if any.

Returns the width of this PdfPage in device-independent points. One point is 1/72 inches, roughly 0.358 mm.

Returns the height of this PdfPage in device-independent points. One point is 1/72 inches, roughly 0.358 mm.

Returns the width and height of this PdfPage expressed as a PdfRect.

Returns PdfPageOrientation::Landscape if the width of this PdfPage is greater than its height; otherwise returns PdfPageOrientation::Portrait.

Returns true if this PdfPage has orientation PdfPageOrientation::Portrait.

Returns true if this PdfPage has orientation PdfPageOrientation::Landscape.

Returns any intrinsic rotation encoded into this document indicating a rotation should be applied to this PdfPage during rendering.

Sets the intrinsic rotation that should be applied to this PdfPage during rendering.

Returns true if any object on the page contains transparency.

Returns the collection of bounding boxes defining the extents of this PdfPage.

Returns the paper size of this PdfPage.

Returns the collection of text boxes contained within this PdfPage.

Returns an immutable collection of all the page objects on this PdfPage.

Returns a mutable collection of all the page objects on this PdfPage.

Returns an immutable collection of the annotations that have been added to this PdfPage.

Returns a PdfBitmap using pixel dimensions, rotation settings, and rendering options configured in the given PdfBitmapConfig.

See also PdfPage::get_bitmap(), which directly creates a PdfBitmap object from this page using caller-specified pixel dimensions and page rotation settings.

Returns a PdfBitmap with the given pixel dimensions and render-time rotation for this PdfPage containing the rendered content of this PdfPage.

It is the responsibility of the caller to ensure the given pixel width and height correctly maintain the page’s aspect ratio.

See also PdfPage::get_bitmap_with_config(), which calculates the correct pixel dimensions, rotation settings, and rendering options to apply from a PdfBitmapConfig object.

Flattens all annotations and form fields on this PdfPage into the page contents.

Returns the strategy used by pdfium-render to regenerate the content of a PdfPage.

Updates to a PdfPage are not committed to the underlying PdfDocument until the page’s content is regenerated. If a page is reloaded or closed without regenerating the page’s content, any changes not applied are lost.

By default, pdfium-render will trigger content regeneration on any change to a PdfPage; this removes the possibility of data loss, and ensures changes can be read back from other data structures as soon as they are made. However, if many changes are made to a page at once, then regenerating the content after every change is inefficient; it is faster to stage all changes first, then regenerate the page’s content just once. In this case, changing the content regeneration strategy for a PdfPage can improve performance, but you must be careful not to forget to commit your changes before closing or reloading the page.

Sets the strategy used by pdfium-render to regenerate the content of a PdfPage.

Updates to a PdfPage are not committed to the underlying PdfDocument until the page’s content is regenerated. If a page is reloaded or closed without regenerating the page’s content, any changes not applied are lost.

By default, pdfium-render will trigger content regeneration on any change to a PdfPage; this removes the possibility of data loss, and ensures changes can be read back from other data structures as soon as they are made. However, if many changes are made to a page at once, then regenerating the content after every change is inefficient; it is faster to stage all changes first, then regenerate the page’s content just once. In this case, changing the content regeneration strategy for a PdfPage can improve performance, but you must be careful not to forget to commit your changes before closing or reloading the page.

Commits any staged but unsaved changes to this PdfPage to the underlying PdfDocument.

Updates to a PdfPage are not committed to the underlying PdfDocument until the page’s content is regenerated. If a page is reloaded or closed without regenerating the page’s content, any changes not applied are lost.

By default, pdfium-render will trigger content regeneration on any change to a PdfPage; this removes the possibility of data loss, and ensures changes can be read back from other data structures as soon as they are made. However, if many changes are made to a page at once, then regenerating the content after every change is inefficient; it is faster to stage all changes first, then regenerate the page’s content just once. In this case, changing the content regeneration strategy for a PdfPage can improve performance, but you must be careful not to forget to commit your changes before closing or reloading the page.

Trait Implementations

Closes this PdfPage, releasing held memory.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.