pub struct PdfPageXObjectFormObject<'a> { /* private fields */ }Expand description
A single PdfPageObject of type PdfPageObjectType::XObjectForm. The page object contains a
content stream that itself may consist of multiple other page objects. When this page object
is rendered, it renders all its constituent page objects, effectively serving as a template or
stamping object.
Despite the page object name including “form”, this page object type bears no relation to an interactive form containing form fields.
Implementations§
Source§impl<'a> PdfPageXObjectFormObject<'a>
impl<'a> PdfPageXObjectFormObject<'a>
Sourcepub fn len(&self) -> PdfPageObjectIndex
pub fn len(&self) -> PdfPageObjectIndex
Returns the total number of child page objects in this PdfPageXObjectFormObject.
Sourcepub fn as_range(&self) -> Range<PdfPageObjectIndex>
pub fn as_range(&self) -> Range<PdfPageObjectIndex>
Returns a Range from 0..(number of objects) for the child page objects in
this PdfPageXObjectFormObject.
Sourcepub fn as_range_inclusive(&self) -> RangeInclusive<PdfPageObjectIndex>
pub fn as_range_inclusive(&self) -> RangeInclusive<PdfPageObjectIndex>
Returns an inclusive Range from 0..=(number of objects - 1) for the child page objects
in this PdfPageXObjectFormObject.
Sourcepub fn get(
&self,
index: PdfPageObjectIndex,
) -> Result<PdfPageObject<'a>, PdfiumError>
pub fn get( &self, index: PdfPageObjectIndex, ) -> Result<PdfPageObject<'a>, PdfiumError>
Returns a single child PdfPageObject from this PdfPageXObjectFormObject.
Sourcepub fn first(&self) -> Result<PdfPageObject<'a>, PdfiumError>
pub fn first(&self) -> Result<PdfPageObject<'a>, PdfiumError>
Returns the first child PdfPageObject in this PdfPageXObjectFormObject.
Sourcepub fn last(&self) -> Result<PdfPageObject<'a>, PdfiumError>
pub fn last(&self) -> Result<PdfPageObject<'a>, PdfiumError>
Returns the last child PdfPageObject in this PdfPageXObjectFormObject.
Sourcepub fn iter(&'a self) -> PdfPageObjectsIterator<'a> ⓘ
pub fn iter(&'a self) -> PdfPageObjectsIterator<'a> ⓘ
Returns an iterator over all the child PdfPageObject objects in this PdfPageXObjectFormObject.
Trait Implementations§
Source§impl<'a> From<PdfPageXObjectFormObject<'a>> for PdfPageObject<'a>
impl<'a> From<PdfPageXObjectFormObject<'a>> for PdfPageObject<'a>
Source§fn from(object: PdfPageXObjectFormObject<'a>) -> Self
fn from(object: PdfPageXObjectFormObject<'a>) -> Self
Auto Trait Implementations§
impl<'a> Freeze for PdfPageXObjectFormObject<'a>
impl<'a> !RefUnwindSafe for PdfPageXObjectFormObject<'a>
impl<'a> !Send for PdfPageXObjectFormObject<'a>
impl<'a> !Sync for PdfPageXObjectFormObject<'a>
impl<'a> Unpin for PdfPageXObjectFormObject<'a>
impl<'a> !UnwindSafe for PdfPageXObjectFormObject<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<'a, T> PdfPageObjectCommon<'a> for Twhere
T: PdfPageObjectPrivate<'a>,
impl<'a, T> PdfPageObjectCommon<'a> for Twhere
T: PdfPageObjectPrivate<'a>,
Source§fn has_transparency(&self) -> bool
fn has_transparency(&self) -> bool
true if this PdfPageObject contains transparency.Source§fn bounds(&self) -> Result<PdfRect, PdfiumError>
fn bounds(&self) -> Result<PdfRect, PdfiumError>
Source§fn transform_from(
&mut self,
other: &PdfPageObject<'_>,
) -> Result<(), PdfiumError>
fn transform_from( &mut self, other: &PdfPageObject<'_>, ) -> Result<(), PdfiumError>
Source§fn set_blend_mode(
&mut self,
blend_mode: PdfPageObjectBlendMode,
) -> Result<(), PdfiumError>
fn set_blend_mode( &mut self, blend_mode: PdfPageObjectBlendMode, ) -> Result<(), PdfiumError>
Source§fn fill_color(&self) -> Result<PdfColor, PdfiumError>
fn fill_color(&self) -> Result<PdfColor, PdfiumError>
Source§fn set_fill_color(&mut self, fill_color: PdfColor) -> Result<(), PdfiumError>
fn set_fill_color(&mut self, fill_color: PdfColor) -> Result<(), PdfiumError>
Source§fn stroke_color(&self) -> Result<PdfColor, PdfiumError>
fn stroke_color(&self) -> Result<PdfColor, PdfiumError>
Source§fn set_stroke_color(
&mut self,
stroke_color: PdfColor,
) -> Result<(), PdfiumError>
fn set_stroke_color( &mut self, stroke_color: PdfColor, ) -> Result<(), PdfiumError>
Source§fn stroke_width(&self) -> Result<PdfPoints, PdfiumError>
fn stroke_width(&self) -> Result<PdfPoints, PdfiumError>
Source§fn set_stroke_width(
&mut self,
stroke_width: PdfPoints,
) -> Result<(), PdfiumError>
fn set_stroke_width( &mut self, stroke_width: PdfPoints, ) -> Result<(), PdfiumError>
Source§fn line_join(&self) -> Result<PdfPageObjectLineJoin, PdfiumError>
fn line_join(&self) -> Result<PdfPageObjectLineJoin, PdfiumError>
Source§fn set_line_join(
&mut self,
line_join: PdfPageObjectLineJoin,
) -> Result<(), PdfiumError>
fn set_line_join( &mut self, line_join: PdfPageObjectLineJoin, ) -> Result<(), PdfiumError>
Source§fn line_cap(&self) -> Result<PdfPageObjectLineCap, PdfiumError>
fn line_cap(&self) -> Result<PdfPageObjectLineCap, PdfiumError>
Source§fn set_line_cap(
&mut self,
line_cap: PdfPageObjectLineCap,
) -> Result<(), PdfiumError>
fn set_line_cap( &mut self, line_cap: PdfPageObjectLineCap, ) -> Result<(), PdfiumError>
Source§fn dash_phase(&self) -> Result<PdfPoints, PdfiumError>
fn dash_phase(&self) -> Result<PdfPoints, PdfiumError>
Source§fn set_dash_phase(&mut self, dash_phase: PdfPoints) -> Result<(), PdfiumError>
fn set_dash_phase(&mut self, dash_phase: PdfPoints) -> Result<(), PdfiumError>
Source§fn dash_array(&self) -> Result<Vec<PdfPoints>, PdfiumError>
fn dash_array(&self) -> Result<Vec<PdfPoints>, PdfiumError>
Source§fn set_dash_array(
&mut self,
array: &[PdfPoints],
phase: PdfPoints,
) -> Result<(), PdfiumError>
fn set_dash_array( &mut self, array: &[PdfPoints], phase: PdfPoints, ) -> Result<(), PdfiumError>
Source§fn is_copyable(&self) -> bool
fn is_copyable(&self) -> bool
true if this PdfPageObject can be successfully copied by calling its
try_copy() function. Read moreSource§fn try_copy<'b>(
&self,
document: &'b PdfDocument<'b>,
) -> Result<PdfPageObject<'b>, PdfiumError>
fn try_copy<'b>( &self, document: &'b PdfDocument<'b>, ) -> Result<PdfPageObject<'b>, PdfiumError>
Source§fn width(&self) -> Result<PdfPoints, PdfiumError>
fn width(&self) -> Result<PdfPoints, PdfiumError>
Source§fn height(&self) -> Result<PdfPoints, PdfiumError>
fn height(&self) -> Result<PdfPoints, PdfiumError>
Source§fn is_inside_rect(&self, rect: &PdfRect) -> bool
fn is_inside_rect(&self, rect: &PdfRect) -> bool
true if the bounds of this PdfPageObject lie entirely within the given rectangle.Source§fn does_overlap_rect(&self, rect: &PdfRect) -> bool
fn does_overlap_rect(&self, rect: &PdfRect) -> bool
true if the bounds of this PdfPageObject lie at least partially within
the given rectangle.Source§impl<'a, T> PdfPageObjectsCommon<'a> for Twhere
T: PdfPageObjectsPrivate<'a>,
impl<'a, T> PdfPageObjectsCommon<'a> for Twhere
T: PdfPageObjectsPrivate<'a>,
Source§fn get(&self, index: usize) -> Result<PdfPageObject<'a>, PdfiumError>
fn get(&self, index: usize) -> Result<PdfPageObject<'a>, PdfiumError>
Source§fn iter(&'a self) -> PdfPageObjectsIterator<'a> ⓘ
fn iter(&'a self) -> PdfPageObjectsIterator<'a> ⓘ
Source§fn add_object(
&mut self,
object: PdfPageObject<'a>,
) -> Result<PdfPageObject<'a>, PdfiumError>
fn add_object( &mut self, object: PdfPageObject<'a>, ) -> Result<PdfPageObject<'a>, PdfiumError>
PdfPage containing this page objects
collection, and the updated page object will be returned. Read moreSource§fn create_text_object(
&mut self,
x: PdfPoints,
y: PdfPoints,
text: impl ToString,
font: impl ToPdfFontToken,
font_size: PdfPoints,
) -> Result<PdfPageObject<'a>, PdfiumError>
fn create_text_object( &mut self, x: PdfPoints, y: PdfPoints, text: impl ToString, font: impl ToPdfFontToken, font_size: PdfPoints, ) -> Result<PdfPageObject<'a>, PdfiumError>
Source§fn create_path_object_line(
&mut self,
x1: PdfPoints,
y1: PdfPoints,
x2: PdfPoints,
y2: PdfPoints,
stroke_color: PdfColor,
stroke_width: PdfPoints,
) -> Result<PdfPageObject<'a>, PdfiumError>
fn create_path_object_line( &mut self, x1: PdfPoints, y1: PdfPoints, x2: PdfPoints, y2: PdfPoints, stroke_color: PdfColor, stroke_width: PdfPoints, ) -> Result<PdfPageObject<'a>, PdfiumError>
Source§fn create_path_object_bezier(
&mut self,
x1: PdfPoints,
y1: PdfPoints,
x2: PdfPoints,
y2: PdfPoints,
control1_x: PdfPoints,
control1_y: PdfPoints,
control2_x: PdfPoints,
control2_y: PdfPoints,
stroke_color: PdfColor,
stroke_width: PdfPoints,
) -> Result<PdfPageObject<'a>, PdfiumError>
fn create_path_object_bezier( &mut self, x1: PdfPoints, y1: PdfPoints, x2: PdfPoints, y2: PdfPoints, control1_x: PdfPoints, control1_y: PdfPoints, control2_x: PdfPoints, control2_y: PdfPoints, stroke_color: PdfColor, stroke_width: PdfPoints, ) -> Result<PdfPageObject<'a>, PdfiumError>
Source§fn create_path_object_rect(
&mut self,
rect: PdfRect,
stroke_color: Option<PdfColor>,
stroke_width: Option<PdfPoints>,
fill_color: Option<PdfColor>,
) -> Result<PdfPageObject<'a>, PdfiumError>
fn create_path_object_rect( &mut self, rect: PdfRect, stroke_color: Option<PdfColor>, stroke_width: Option<PdfPoints>, fill_color: Option<PdfColor>, ) -> Result<PdfPageObject<'a>, PdfiumError>
Source§fn create_path_object_circle(
&mut self,
rect: PdfRect,
stroke_color: Option<PdfColor>,
stroke_width: Option<PdfPoints>,
fill_color: Option<PdfColor>,
) -> Result<PdfPageObject<'a>, PdfiumError>
fn create_path_object_circle( &mut self, rect: PdfRect, stroke_color: Option<PdfColor>, stroke_width: Option<PdfPoints>, fill_color: Option<PdfColor>, ) -> Result<PdfPageObject<'a>, PdfiumError>
Source§fn create_path_object_circle_at(
&mut self,
center_x: PdfPoints,
center_y: PdfPoints,
radius: PdfPoints,
stroke_color: Option<PdfColor>,
stroke_width: Option<PdfPoints>,
fill_color: Option<PdfColor>,
) -> Result<PdfPageObject<'a>, PdfiumError>
fn create_path_object_circle_at( &mut self, center_x: PdfPoints, center_y: PdfPoints, radius: PdfPoints, stroke_color: Option<PdfColor>, stroke_width: Option<PdfPoints>, fill_color: Option<PdfColor>, ) -> Result<PdfPageObject<'a>, PdfiumError>
Source§fn create_path_object_ellipse(
&mut self,
rect: PdfRect,
stroke_color: Option<PdfColor>,
stroke_width: Option<PdfPoints>,
fill_color: Option<PdfColor>,
) -> Result<PdfPageObject<'a>, PdfiumError>
fn create_path_object_ellipse( &mut self, rect: PdfRect, stroke_color: Option<PdfColor>, stroke_width: Option<PdfPoints>, fill_color: Option<PdfColor>, ) -> Result<PdfPageObject<'a>, PdfiumError>
Source§fn create_path_object_ellipse_at(
&mut self,
center_x: PdfPoints,
center_y: PdfPoints,
x_radius: PdfPoints,
y_radius: PdfPoints,
stroke_color: Option<PdfColor>,
stroke_width: Option<PdfPoints>,
fill_color: Option<PdfColor>,
) -> Result<PdfPageObject<'a>, PdfiumError>
fn create_path_object_ellipse_at( &mut self, center_x: PdfPoints, center_y: PdfPoints, x_radius: PdfPoints, y_radius: PdfPoints, stroke_color: Option<PdfColor>, stroke_width: Option<PdfPoints>, fill_color: Option<PdfColor>, ) -> Result<PdfPageObject<'a>, PdfiumError>
Source§fn create_image_object(
&mut self,
x: PdfPoints,
y: PdfPoints,
image: &DynamicImage,
width: Option<PdfPoints>,
height: Option<PdfPoints>,
) -> Result<PdfPageObject<'a>, PdfiumError>
fn create_image_object( &mut self, x: PdfPoints, y: PdfPoints, image: &DynamicImage, width: Option<PdfPoints>, height: Option<PdfPoints>, ) -> Result<PdfPageObject<'a>, PdfiumError>
Source§fn remove_object(
&mut self,
object: PdfPageObject<'a>,
) -> Result<PdfPageObject<'a>, PdfiumError>
fn remove_object( &mut self, object: PdfPageObject<'a>, ) -> Result<PdfPageObject<'a>, PdfiumError>
PdfPage containing this page objects
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. Read moreSource§fn remove_object_at_index(
&mut self,
index: usize,
) -> Result<PdfPageObject<'a>, PdfiumError>
fn remove_object_at_index( &mut self, index: usize, ) -> Result<PdfPageObject<'a>, PdfiumError>
PdfPage containing this page objects
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 freed. Read moreSource§fn as_range(&self) -> Range<PdfPageObjectIndex>
fn as_range(&self) -> Range<PdfPageObjectIndex>
0..(number of objects) for this page objects collection.Source§fn as_range_inclusive(&self) -> RangeInclusive<PdfPageObjectIndex>
fn as_range_inclusive(&self) -> RangeInclusive<PdfPageObjectIndex>
0..=(number of objects - 1) for this page objects collection.