Enum pdfium_render::page_object::PdfPageObject
source · [−]pub enum PdfPageObject<'a> {
Text(PdfPageTextObject<'a>),
Path(PdfPagePathObject<'a>),
Image(PdfPageImageObject<'a>),
Shading(PdfPageShadingObject<'a>),
FormFragment(PdfPageFormFragmentObject<'a>),
Unsupported(PdfPageUnsupportedObject<'a>),
}Variants
Text(PdfPageTextObject<'a>)
Path(PdfPagePathObject<'a>)
Image(PdfPageImageObject<'a>)
Shading(PdfPageShadingObject<'a>)
FormFragment(PdfPageFormFragmentObject<'a>)
Unsupported(PdfPageUnsupportedObject<'a>)
Common properties shared by all PdfPageObject types can still be accessed for page objects not recognized by Pdfium, but object-specific functionality will be unavailable.
Implementations
sourceimpl<'a> PdfPageObject<'a>
impl<'a> PdfPageObject<'a>
sourcepub fn object_type(&self) -> PdfPageObjectType
pub fn object_type(&self) -> PdfPageObjectType
The object type of this PdfPageObject.
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.
sourcepub fn is_unsupported(&self) -> bool
pub fn is_unsupported(&self) -> bool
Returns true if this PdfPageObject has an object type of PdfPageObjectType::Unsupported.
Common properties shared by all PdfPageObject types can still be accessed for page objects not recognized by Pdfium, but object-specific functionality will be unavailable.
sourcepub fn as_text_object(&self) -> Option<&PdfPageTextObject<'_>>
pub fn as_text_object(&self) -> Option<&PdfPageTextObject<'_>>
Returns the underlying PdfPageTextObject for this PdfPageObject, if this page object has an object type of PdfPageObjectType::Text.
sourcepub fn as_path_object(&self) -> Option<&PdfPagePathObject<'_>>
pub fn as_path_object(&self) -> Option<&PdfPagePathObject<'_>>
Returns the underlying PdfPagePathObject for this PdfPageObject, if this page object has an object type of PdfPageObjectType::Path.
sourcepub fn as_image_object(&self) -> Option<&PdfPageImageObject<'_>>
pub fn as_image_object(&self) -> Option<&PdfPageImageObject<'_>>
Returns the underlying PdfPageImageObject for this PdfPageObject, if this page object has an object type of PdfPageObjectType::Image.
sourcepub fn as_shading_object(&self) -> Option<&PdfPageShadingObject<'_>>
pub fn as_shading_object(&self) -> Option<&PdfPageShadingObject<'_>>
Returns the underlying PdfPageShadingObject for this PdfPageObject, if this page object has an object type of PdfPageObjectType::Shading.
sourcepub fn as_form_fragment_object(&self) -> Option<&PdfPageFormFragmentObject<'_>>
pub fn as_form_fragment_object(&self) -> Option<&PdfPageFormFragmentObject<'_>>
Returns the underlying PdfPageFormFragmentObject for this PdfPageObject, if this page object has an object type of PdfPageObjectType::FormFragment.
Trait Implementations
sourceimpl<'a> Drop for PdfPageObject<'a>
impl<'a> Drop for PdfPageObject<'a>
sourcefn drop(&mut self)
fn drop(&mut self)
Closes the PdfPageObject, releasing held memory.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for PdfPageObject<'a>
impl<'a> !Send for PdfPageObject<'a>
impl<'a> !Sync for PdfPageObject<'a>
impl<'a> Unpin for PdfPageObject<'a>
impl<'a> !UnwindSafe for PdfPageObject<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'a, T> PdfPageObjectCommon<'a> for T where
T: PdfPageObjectPrivate<'a>,
impl<'a, T> PdfPageObjectCommon<'a> for T where
T: PdfPageObjectPrivate<'a>,
sourcefn index(&self) -> PdfPageObjectIndex
fn index(&self) -> PdfPageObjectIndex
Returns the zero-based object index of this PdfPageObject in its containing PdfPage.
sourcefn has_transparency(&self) -> bool
fn has_transparency(&self) -> bool
Returns true if this PdfPageObject contains transparency.
sourcefn bounding(&self) -> Result<PdfRect, PdfiumError>
fn bounding(&self) -> Result<PdfRect, PdfiumError>
Returns the bounding box of this PdfPageObject.