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

A single PdfPageObject of type PdfPageObjectType::Text.

Page objects can be created either attached to a PdfPage (in which case the page object’s memory is owned by the containing page) or detached from any page (in which case the page object’s memory is owned by the object). Page objects are not rendered until they are attached to a page; page objects that are never attached to a page will be lost when they fall out of scope.

The simplest way to create a page text object that is immediately attached to a page is to call the PdfPageObjects::create_text_object() function.

Creating a detached page text object offers more scope for customization, but you must add the object to a containing PdfPage manually. To create a detached page text object, use the PdfPageTextObject::new() function. The detached page text object can later be attached to a page by using the PdfPageObjects::add_object() function.

Implementations

Creates a new PdfPageTextObject from the given arguments. The returned page object will not be rendered until it is added to a PdfPage using the PdfPageObjects::add_text_object() function.

A single space will be used if the given text is empty, in order to avoid unexpected behaviour from Pdfium when dealing with empty strings.

Returns the text rendering mode for the text contained within this PdfPageTextObject.

Returns the font size of the text contained within this PdfPageTextObject, expressed in PdfPoints.

Returns the PdfFont used to render the text contained within this PdfPageTextObject.

Returns the text contained within this PdfPageTextObject.

Text retrieval in Pdfium is handled by the PdfPageText object owned by the PdfPage containing this PdfPageTextObject. If this text object has not been attached to a page then text retrieval will be unavailable and an empty string will be returned.

When retrieving the text from many PdfPageTextObject objects (for instance, as part of a loop or an iterator), it may be faster to open the PdfPageText object once and keep it open while processing the text objects, like so:

let text_page = page.text()?; // Opens the text page once.

for object in <some object iterator> {
    let object_text = text_page.for_object(object)?;
}

The PdfPageText object will be closed when the binding to it (text_page in the example above) falls out of scope.

Sets the text contained within this PdfPageTextObject, replacing any existing text.

A single space will be used if the given text is empty, in order to avoid unexpected behaviour from Pdfium when dealing with an empty string.

Sets the text rendering mode for the text contained within this PdfPageTextObject.

Trait Implementations

Converts to this type from the input type.

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.

Returns true if this PdfPageObject contains transparency.

Returns the bounding box of this PdfPageObject.

Applies the given transformation, expressed as six values representing the six configurable elements of a nine-element 3x3 PDF transformation matrix, to this PdfPageObject. Read more

Sets the blend mode that will be applied when painting this PdfPageObject. Read more

Returns the color of any filled paths in this PdfPageObject.

Sets the color of any filled paths in this PdfPageObject.

Returns the color of any stroked lines in this PdfPageObject.

Sets the color of any stroked lines in this PdfPageObject. Read more

Returns the width of any stroked lines in this PdfPageObject.

Sets the width of any stroked lines in this PdfPageObject. Read more

Returns the line join style that will be used when painting stroked path segments in this PdfPageObject. Read more

Sets the line join style that will be used when painting stroked path segments in this PdfPageObject. Read more

Returns the line cap style that will be used when painting stroked path segments in this PdfPageObject. Read more

Sets the line cap style that will be used when painting stroked path segments in this PdfPageObject. Read more

Returns the method used to determine which sub-paths of any path in this PdfPageObject should be filled. Read more

Returns true if this PdfPageObject will be stroked, regardless of the path’s stroke settings. Read more

Sets the method used to determine which sub-paths of any path in this PdfPageObject should be filled, and whether or not any path in this PdfPageObject should be stroked. Read more

Returns the width of this PdfPageObject.

Returns the height of this PdfPageObject.

Returns true if the bounds of this PdfPageObject lie entirely within the given rectangle.

Returns true if the bounds of this PdfPageObject lie at least partially within the given rectangle. Read more

Moves the origin of this PdfPageObject by the given horizontal and vertical delta distances.

Changes the size of this PdfPageObject, scaling it by the given horizontal and vertical scale factors. Read more

Rotates this PdfPageObject counter-clockwise by the given number of degrees.

Rotates this PdfPageObject clockwise by the given number of degrees.

Rotates this PdfPageObject counter-clockwise by the given number of radians.

Rotates this PdfPageObject clockwise by the given number of radians.

Skews the axes of this PdfPageObject by the given angles in degrees.

Skews the axes of this PdfPageObject by the given angles in radians.

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.