pub struct Page { /* private fields */ }Expand description
A page under construction. Obtain one with PdfDoc::add_page.
Implementations§
Source§impl Page
impl Page
pub fn width(&self) -> f32
pub fn height(&self) -> f32
Sourcepub fn link_uri(&mut self, x: f32, y: f32, w: f32, h: f32, uri: &str)
pub fn link_uri(&mut self, x: f32, y: f32, w: f32, h: f32, uri: &str)
Adds an invisible clickable area for an external URI. Invalid or excessive links are ignored.
Sourcepub fn link_page(&mut self, rect: Rect, page: usize, target: Point)
pub fn link_page(&mut self, rect: Rect, page: usize, target: Point)
Adds a link to a location on another page of this document (zero-based page index).
Sourcepub fn save(&mut self)
pub fn save(&mut self)
Saves the graphics state (pair with Page::restore).
Sourcepub fn restore(&mut self)
pub fn restore(&mut self)
Restores the graphics state saved by Page::save; extra calls are ignored.
Sourcepub fn clip_rect(&mut self, x: f32, y: f32, w: f32, h: f32)
pub fn clip_rect(&mut self, x: f32, y: f32, w: f32, h: f32)
Intersects the clip with a rectangle (until the next Page::restore).
pub fn fill_rect(&mut self, x: f32, y: f32, w: f32, h: f32, color: Rgb)
pub fn rect_stroke( &mut self, x: f32, y: f32, w: f32, h: f32, width: f32, color: Rgb, )
pub fn stroke_line( &mut self, x0: f32, y0: f32, x1: f32, y1: f32, width: f32, color: Rgb, )
Sourcepub fn stroke_line_dashed(
&mut self,
start: Point,
end: Point,
width: f32,
color: Rgb,
dash: &[f32],
)
pub fn stroke_line_dashed( &mut self, start: Point, end: Point, width: f32, color: Rgb, dash: &[f32], )
A line with a dash pattern ([on, off, …] in points; empty = solid).
Sourcepub fn polyline(
&mut self,
pts: &[[f32; 2]],
width: f32,
color: Rgb,
dash: &[f32],
)
pub fn polyline( &mut self, pts: &[[f32; 2]], width: f32, color: Rgb, dash: &[f32], )
An open polyline.
Sourcepub fn polygon(
&mut self,
pts: &[[f32; 2]],
fill: Option<Rgb>,
stroke: Option<(Rgb, f32)>,
)
pub fn polygon( &mut self, pts: &[[f32; 2]], fill: Option<Rgb>, stroke: Option<(Rgb, f32)>, )
A closed polygon, filled and/or stroked.
Sourcepub fn circle(
&mut self,
cx: f32,
cy: f32,
r: f32,
fill: Option<Rgb>,
stroke: Option<(Rgb, f32)>,
)
pub fn circle( &mut self, cx: f32, cy: f32, r: f32, fill: Option<Rgb>, stroke: Option<(Rgb, f32)>, )
A circle approximated by four cubic Béziers.
Sourcepub fn text(
&mut self,
x: f32,
y: f32,
size: f32,
font: Font,
color: Rgb,
text: &str,
)
pub fn text( &mut self, x: f32, y: f32, size: f32, font: Font, color: Rgb, text: &str, )
Text with its baseline starting at (x, y).
Auto Trait Implementations§
impl Freeze for Page
impl RefUnwindSafe for Page
impl Send for Page
impl Sync for Page
impl Unpin for Page
impl UnsafeUnpin for Page
impl UnwindSafe for Page
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