pub struct PDPage {
pub dict: COSDictionary,
pub page_id: Option<ObjectId>,
pub resources: PDResources,
}Expand description
Represents a single page in a PDF document.
Fields§
§dict: COSDictionary§page_id: Option<ObjectId>§resources: PDResourcesImplementations§
Source§impl PDPage
impl PDPage
Sourcepub fn new(media_box: PDRectangle) -> Self
pub fn new(media_box: PDRectangle) -> Self
Creates a new page with the given media box.
Sourcepub fn from_dict(dict: COSDictionary, page_id: ObjectId) -> Self
pub fn from_dict(dict: COSDictionary, page_id: ObjectId) -> Self
Loads a page from an existing page dictionary and its object ID.
pub fn media_box(&self) -> PDRectangle
pub fn set_media_box(&mut self, rect: PDRectangle)
pub fn crop_box(&self) -> PDRectangle
pub fn set_crop_box(&mut self, rect: PDRectangle)
pub fn rotation(&self) -> i32
pub fn set_rotation(&mut self, rotation: i32)
Sourcepub fn sync_resources(&mut self)
pub fn sync_resources(&mut self)
Synchronizes the resources dictionary back into the page dictionary.
Sourcepub fn content_stream_ids(&self) -> Vec<ObjectId>
pub fn content_stream_ids(&self) -> Vec<ObjectId>
Retrieves all content stream ObjectIds referenced in /Contents.
Sourcepub fn set_contents(&mut self, content_ref: ObjectId)
pub fn set_contents(&mut self, content_ref: ObjectId)
Sets a single content stream reference for /Contents.
Sourcepub fn set_contents_array(&mut self, content_refs: Vec<ObjectId>)
pub fn set_contents_array(&mut self, content_refs: Vec<ObjectId>)
Sets multiple content streams for /Contents.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PDPage
impl RefUnwindSafe for PDPage
impl Send for PDPage
impl Sync for PDPage
impl Unpin for PDPage
impl UnsafeUnpin for PDPage
impl UnwindSafe for PDPage
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
Mutably borrows from an owned value. Read more