Struct pdf_writer::writers::Page
source · pub struct Page<'a> { /* private fields */ }
Expand description
Writer for a page dictionary.
This struct is created by Chunk::page
.
Implementations§
source§impl<'a> Page<'a>
impl<'a> Page<'a>
sourcepub fn last_modified(&mut self, date: Date) -> &mut Self
pub fn last_modified(&mut self, date: Date) -> &mut Self
Write the /LastModified
attribute. PDF 1.3+.
sourcepub fn media_box(&mut self, rect: Rect) -> &mut Self
pub fn media_box(&mut self, rect: Rect) -> &mut Self
Write the /MediaBox
attribute. This is the size of the physical medium
the page gets printed onto.
sourcepub fn crop_box(&mut self, rect: Rect) -> &mut Self
pub fn crop_box(&mut self, rect: Rect) -> &mut Self
Write the /CropBox
attribute. This is the size of the area within
which content is visible.
sourcepub fn bleed_box(&mut self, rect: Rect) -> &mut Self
pub fn bleed_box(&mut self, rect: Rect) -> &mut Self
Write the /BleedBox
attribute. This is the size of the area within
which content is visible in a print production environment. Most
production-aiding marks should be outside of this box. PDF 1.3+.
sourcepub fn trim_box(&mut self, rect: Rect) -> &mut Self
pub fn trim_box(&mut self, rect: Rect) -> &mut Self
Write the /TrimBox
attribute. This is the size of the produced
document after trimming is applied. PDF 1.3+.
sourcepub fn art_box(&mut self, rect: Rect) -> &mut Self
pub fn art_box(&mut self, rect: Rect) -> &mut Self
Write the /ArtBox
attribute. This is the area that another program
importing this file should use. PDF 1.3+.
sourcepub fn contents(&mut self, id: Ref) -> &mut Self
pub fn contents(&mut self, id: Ref) -> &mut Self
Write the /Contents
attribute as reference to a single content stream.
Such a content stream can be created using the Content
builder and
written to the file using Chunk::stream
.
sourcepub fn contents_array(
&mut self,
ids: impl IntoIterator<Item = Ref>
) -> &mut Self
pub fn contents_array( &mut self, ids: impl IntoIterator<Item = Ref> ) -> &mut Self
Write the /Contents
attribute as an array.
sourcepub fn rotate(&mut self, degrees: i32) -> &mut Self
pub fn rotate(&mut self, degrees: i32) -> &mut Self
Write the /Rotate
attribute. This is the number of degrees the page
should be rotated clockwise when displayed. This should be a multiple
of 90.
sourcepub fn group(&mut self) -> Group<'_>
pub fn group(&mut self) -> Group<'_>
Start writing the /Group
dictionary to set the transparency settings
for the page. PDF 1.4+.
sourcepub fn thumbnail(&mut self, id: Ref) -> &mut Self
pub fn thumbnail(&mut self, id: Ref) -> &mut Self
Write the /Thumb
attribute to set an image as the page
thumbnail. Must be RGB, Grayscale, or an indexed color space based on
the former two.
sourcepub fn duration(&mut self, seconds: f32) -> &mut Self
pub fn duration(&mut self, seconds: f32) -> &mut Self
Write the /Dur
attribute. This is the amount of seconds the page
should be displayed before advancing to the next one. PDF 1.1+.
sourcepub fn transition(&mut self) -> Transition<'_>
pub fn transition(&mut self) -> Transition<'_>
Start writing the /Trans
dictionary. This sets a transition effect for
advancing to the next page. PDF 1.1+.
sourcepub fn annotations(&mut self) -> TypedArray<'_, Annotation<'_>>
pub fn annotations(&mut self) -> TypedArray<'_, Annotation<'_>>
Start writing the /Annots
(annotations) array.’
sourcepub fn struct_parents(&mut self, key: i32) -> &mut Self
pub fn struct_parents(&mut self, key: i32) -> &mut Self
Write the /StructParents
attribute to indicate the structure tree
elements the contents of this XObject may belong to. PDF 1.3+.
sourcepub fn tab_order(&mut self, order: TabOrder) -> &mut Self
pub fn tab_order(&mut self, order: TabOrder) -> &mut Self
Write the /Tabs
attribute. This specifies the order in which the
annotations should be focused by hitting tab. PDF 1.5+.
sourcepub fn user_unit(&mut self, value: f32) -> &mut Self
pub fn user_unit(&mut self, value: f32) -> &mut Self
Write the /UserUnit
attribute. This sets how large a user space unit
is in printer’s points (1/72 inch). This defaults to 1.0
. PDF 1.6+.
sourcepub fn metadata(&mut self, id: Ref) -> &mut Self
pub fn metadata(&mut self, id: Ref) -> &mut Self
Write the /Metadata
attribute to specify the page’s metadata. PDF
1.4+.
The reference shall point to a metadata stream.
Methods from Deref<Target = Dict<'a>>§
sourcepub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
pub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
Start writing a pair with an arbitrary value.