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

The page objects contained within a single PdfPage.

Content on a page is structured as a stream of PdfPageObject objects of different types: text objects, image objects, path objects, and so on.

Note that Pdfium does not support or recognize all PDF page object types. For instance, Pdfium does not currently support or recognize the External Object (“XObject”) page object type supported by Adobe Acrobat and Foxit’s commercial PDF SDK. In these cases, Pdfium will return PdfPageObjectType::Unsupported.

Implementations

Returns the total number of page objects within the containing PdfPage.

Returns true if this PdfPageObjects collection is empty.

Returns a Range from 0..(number of objects) for this PdfPageObjects collection.

Returns an inclusive Range from 0..=(number of objects - 1) for this PdfPageObjects collection.

Returns a single PdfPageObject from this PdfPageObjects collection.

Returns an iterator over all the page objects in this PdfPageObjects collection.

Adds the given PdfPageObject to this PdfPageObjects collection. The object’s memory ownership will be transferred to the PdfPage containing this PdfPageObjects collection, and the updated page object will be returned.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Adds the given PdfPageTextObject to this PdfPageObjects collection, returning the text object wrapped inside a generic PdfPageObject wrapper.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Creates a new PdfPageTextObject at the given x and y page co-ordinates from the given arguments and adds it to this PdfPageObjects collection, returning the text object wrapped inside a generic PdfPageObject wrapper.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then the content regeneration will be triggered on the page.

Deletes the given PdfPageObject from this PdfPageObjects collection. The object’s memory ownership will be removed from the PdfPage containing this PdfPageObjects collection, and the updated page object will be returned. It can be added back to a page objects collection or dropped, at which point the memory owned by the object will be freed.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Deletes the PdfPageObject at the given index from this PdfPageObjects collection. The object’s memory ownership will be removed from the PdfPage containing this PdfPageObjects collection, and the updated page object will be returned. It can be added back into a page objects collection or discarded, at which point the memory owned by the object will be dropped.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Copies a single page object with the given source page object index from the given source PdfPage, adding the object to the end of this PdfPageObjects collection.

Note that Pdfium does not support or recognize all PDF page object types. For instance, Pdfium does not currently support or recognize the External Object (“XObject”) page object type supported by Adobe Acrobat and Foxit’s commercial PDF SDK. If the page object is of a type not supported by Pdfium, it will be silently ignored and not copied.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Copies one or more page objects with the given range of indices from the given source PdfPage, adding the objects sequentially to the end of this PdfPageObjects collection.

Note that Pdfium does not support or recognize all PDF page object types. For instance, Pdfium does not currently support or recognize the External Object (“XObject”) page object type supported by Adobe Acrobat and Foxit’s commercial PDF SDK. Page objects not supported by Pdfium will be silently ignored by this function and will not copied.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Copies all page objects in the given PdfPage into this PdfPageObjects collection, appending them to the end of this PdfPageObjects collection.

For finer control over which page objects are imported, use one of the PdfPageObjects::copy_object_from_page() or PdfPageObjects::copy_object_range_from_page() functions. To drain page objects from the given PdfPage rather than copying them, use the PdfPageObjects::take_all() function.

Note that Pdfium does not support or recognize all PDF page object types. For instance, Pdfium does not currently support or recognize the External Object (“XObject”) page object type supported by Adobe Acrobat and Foxit’s commercial PDF SDK. Page objects not supported by Pdfium will be silently ignored by this function and will not copied.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Calling this function is equivalent to

self.import_object_range_from_page(
    page, // Source
    page.objects().as_range_inclusive(), // Select all page objects
);

Removes a single page object with the given source page object index from the given source PdfPage, adding the object to the end of this PdfPageObjects collection.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Likewise, if the given source PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the source page.

Removes one or more page objects with the given range of indices from the given source PdfPage, adding the objects sequentially to the end of this PdfPageObjects collection.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Likewise, if the given source PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the source page.

Removes all page objects in the given PdfPage into this PdfPageObjects collection, appending them to the end of this PdfPageObjects collection. The given PdfPage will be drained of all page objects once this operation is completed.

For finer control over which page objects are imported, use one of the PdfPageObjects::take_object_from_page() or PdfPageObjects::take_object_range_from_page() functions. To copy page objects from the given PdfPage rather than removing them, use the PdfPageObjects::copy_all() function.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Likewise, if the given source PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the source page.

Calling this function is equivalent to

self.take_object_range_from_page(
    page, // Source
    page.objects().as_range_inclusive(), // Select all page objects
);

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.