Struct pdfpdf::Pdf
[−]
[src]
pub struct Pdf { /* fields omitted */ }
The top-level struct that represents a (partially) in-memory PDF file
Methods
impl Pdf
[src]
fn new() -> Self
[src]
Create a new blank PDF document
fn new_uncompressed() -> Self
[src]
Create a new blank PDF document without compression
fn set_line_width<N: NumCast>(&mut self, width: N) -> &mut Self
[src]
Set the current line width
fn set_color(&mut self, color: &Color) -> &mut Self
[src]
Set the color for all subsequent drawing operations
fn transform(&mut self, m: Matrix) -> &mut Self
[src]
Apply a coordinate transformation to all subsequent drawing calls Consecutive applications of this function are cumulative
fn draw_circle<N1: NumCast, N2: NumCast, N3: NumCast>(
&mut self,
x: N1,
y: N2,
radius: N3
) -> &mut Self
[src]
&mut self,
x: N1,
y: N2,
radius: N3
) -> &mut Self
Draw a circle with the current drawing configuration, based on http://spencermortensen.com/articles/bezier-circle/
fn draw_line<I, N: NumCast>(&mut self, points: I) -> &mut Self where
I: Iterator<Item = (N, N)>,
[src]
I: Iterator<Item = (N, N)>,
Draw a line between all these points in the order they appear
fn draw_rectangle_filled<N1: NumCast, N2: NumCast, N3: NumCast, N4: NumCast>(
&mut self,
x: N1,
y: N2,
width: N3,
height: N4
) -> &mut Self
[src]
&mut self,
x: N1,
y: N2,
width: N3,
height: N4
) -> &mut Self
Draw a rectangle that extends from x1, y1 to x2, y2
fn font<N: NumCast>(&mut self, font: Font, size: N) -> &mut Self
[src]
Set the font for all subsequent drawing calls
fn draw_text<N1: NumCast, N2: NumCast>(
&mut self,
x: N1,
y: N2,
alignment: Alignment,
text: &str
) -> &mut Self
[src]
&mut self,
x: N1,
y: N2,
alignment: Alignment,
text: &str
) -> &mut Self
Draw text at a given location with the current settings
fn add_page<N1: NumCast, N2: NumCast>(
&mut self,
width: N1,
height: N2
) -> &mut Self
[src]
&mut self,
width: N1,
height: N2
) -> &mut Self
Move to a new page in the PDF document
fn write_to(&mut self, filename: &str) -> Result<()>
[src]
Write the in-memory PDF representation to disk