pub struct PdfPageBoundaries<'a> { /* private fields */ }Expand description
The page boundaries of a single PdfPage.
The content of a page can be bounded by up to six different boxes:
- Media box: the full page size, equivalent to the target paper size when the document is printed. All other page boundaries must fit inside the Media box.
- Art box: the maximum extent of out-of-bleed page art when offset printing. Typically cropped out when viewing the document on-screen.
- Bleed box: the maximum extent of outside-trim page bleeds when offset printing. Typically cropped out when viewing the document on-screen.
- Trim box: the maximum extent of page trims when offset printing. Typically cropped out when viewing the document on-screen.
- Crop box: the maximum extent of user-visible content when viewing the document on-screen.
- Bounding box (“BBox”): the smallest rectangle that can enclose all the content contained in the page.
These boundaries are concentric, i.e. the Bounding box must fit within the Crop box, which must fit within the Trim box, and so on. The Media box therefore contains all other boxes. Not all boxes are guaranteed to exist for all pages.
For more information, see section 10.10.1 on page 962 of the PDF Reference Manual version 1.7, or visit: https://www.pdfscripting.com/public/PDF-Page-Coordinates.cfm#UserSpace
Implementations§
Source§impl<'a> PdfPageBoundaries<'a>
impl<'a> PdfPageBoundaries<'a>
Sourcepub fn bindings(&self) -> &'a dyn PdfiumLibraryBindings
pub fn bindings(&self) -> &'a dyn PdfiumLibraryBindings
Returns the PdfiumLibraryBindings used by this PdfPageBoundaries collection.
Sourcepub fn get(
&self,
boundary: PdfPageBoundaryBoxType,
) -> Result<PdfPageBoundaryBox, PdfiumError>
pub fn get( &self, boundary: PdfPageBoundaryBoxType, ) -> Result<PdfPageBoundaryBox, PdfiumError>
Returns the boundary box defined for the containing PdfPage matching the given PdfPageBoundaryBoxType, if any.
Sourcepub fn set(
&mut self,
box_type: PdfPageBoundaryBoxType,
rect: PdfRect,
) -> Result<(), PdfiumError>
pub fn set( &mut self, box_type: PdfPageBoundaryBoxType, rect: PdfRect, ) -> Result<(), PdfiumError>
Sets the boundary box matching the given PdfPageBoundaryBoxType to the given PdfRect for the containing PdfPage.
Sourcepub fn media(&self) -> Result<PdfPageBoundaryBox, PdfiumError>
pub fn media(&self) -> Result<PdfPageBoundaryBox, PdfiumError>
Returns the Media boundary box defined for the containing PdfPage, if any. The Media box is the full page size, equivalent to the target paper size when the document is printed.
Sourcepub fn art(&self) -> Result<PdfPageBoundaryBox, PdfiumError>
pub fn art(&self) -> Result<PdfPageBoundaryBox, PdfiumError>
Returns the Art boundary box defined for the containing PdfPage, if any. The Art box is the maximum extent of out-of-bleed page art when offset printing. It is typically cropped out when viewing the document on-screen.
Sourcepub fn bleed(&self) -> Result<PdfPageBoundaryBox, PdfiumError>
pub fn bleed(&self) -> Result<PdfPageBoundaryBox, PdfiumError>
Returns the Bleed boundary box defined for the containing PdfPage, if any. The Bleed box is the maximum extent of outside-trim page bleeds when offset printing. It is typically cropped out when viewing the document on-screen.
Sourcepub fn trim(&self) -> Result<PdfPageBoundaryBox, PdfiumError>
pub fn trim(&self) -> Result<PdfPageBoundaryBox, PdfiumError>
Returns the Trim boundary box defined for the containing PdfPage, if any. The Trim box is the maximum extent of page trims when offset printing. It is typically cropped out when viewing the document on-screen.
Sourcepub fn crop(&self) -> Result<PdfPageBoundaryBox, PdfiumError>
pub fn crop(&self) -> Result<PdfPageBoundaryBox, PdfiumError>
Returns the Crop boundary box defined for the containing PdfPage, if any. The Crop box is the maximum extent of user-visible content when viewing the document on-screen.
Sourcepub fn bounding(&self) -> Result<PdfPageBoundaryBox, PdfiumError>
pub fn bounding(&self) -> Result<PdfPageBoundaryBox, PdfiumError>
Returns the Bounding box (“BBox”) defined for the containing PdfPage, if any. The BBox is the smallest rectangle that can enclose all the content contained in the page. Unlike other boundary boxes, the BBox is computed dynamically on request and cannot be set explicitly.
Sourcepub fn iter(&'a self) -> PageBoundaryIterator<'a> ⓘ
pub fn iter(&'a self) -> PageBoundaryIterator<'a> ⓘ
Returns an iterator over all defined PdfPageBoundaryBox boxes in the containing PdfPage.
Not all boxes are guaranteed to exist for all pages, but where they are defined they will
be returned strictly in enclosing order from outermost to innermost:
Media, Art, Bleed, Trim, Crop, Bounding.
Auto Trait Implementations§
impl<'a> Freeze for PdfPageBoundaries<'a>
impl<'a> !RefUnwindSafe for PdfPageBoundaries<'a>
impl<'a> !Send for PdfPageBoundaries<'a>
impl<'a> !Sync for PdfPageBoundaries<'a>
impl<'a> Unpin for PdfPageBoundaries<'a>
impl<'a> !UnwindSafe for PdfPageBoundaries<'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 more