pub struct PDPageContentStream {
pub mode: AppendMode,
/* private fields */
}Expand description
Content stream builder for rendering text, paths, graphics states and images on a page.
Fields§
§mode: AppendModeImplementations§
Source§impl PDPageContentStream
impl PDPageContentStream
pub fn new(mode: AppendMode) -> Self
pub fn write_str(&mut self, s: &str)
pub fn write_line(&mut self, s: &str)
pub fn save_graphics_state(&mut self) -> &mut Self
pub fn restore_graphics_state(&mut self) -> &mut Self
pub fn set_line_width(&mut self, width: f64) -> &mut Self
pub fn set_line_cap(&mut self, cap: i32) -> &mut Self
pub fn set_line_join(&mut self, join: i32) -> &mut Self
pub fn set_stroke_color(&mut self, color: Color) -> &mut Self
pub fn set_fill_color(&mut self, color: Color) -> &mut Self
pub fn set_opacity_on_page( &mut self, page: &mut PDPage, stroke_alpha: f64, fill_alpha: f64, ) -> &mut Self
pub fn set_opacity( &mut self, doc: &mut PDDocument, page_index: usize, stroke_alpha: f64, fill_alpha: f64, ) -> &mut Self
pub fn transform( &mut self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64, ) -> &mut Self
pub fn translate(&mut self, tx: f64, ty: f64) -> &mut Self
pub fn scale(&mut self, sx: f64, sy: f64) -> &mut Self
pub fn rotate(&mut self, degrees: f64, cx: f64, cy: f64) -> &mut Self
pub fn move_to(&mut self, x: f64, y: f64) -> &mut Self
pub fn line_to(&mut self, x: f64, y: f64) -> &mut Self
pub fn curve_to( &mut self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, ) -> &mut Self
pub fn rect(&mut self, x: f64, y: f64, width: f64, height: f64) -> &mut Self
pub fn circle(&mut self, cx: f64, cy: f64, r: f64) -> &mut Self
pub fn round_rect( &mut self, x: f64, y: f64, w: f64, h: f64, r: f64, ) -> &mut Self
pub fn close_path(&mut self) -> &mut Self
pub fn stroke(&mut self) -> &mut Self
pub fn fill(&mut self) -> &mut Self
pub fn fill_and_stroke(&mut self) -> &mut Self
pub fn clip(&mut self) -> &mut Self
pub fn begin_text(&mut self) -> &mut Self
pub fn end_text(&mut self) -> &mut Self
pub fn set_font(&mut self, font_name: &str, size: f64) -> &mut Self
pub fn set_font_type1( &mut self, doc: &mut PDDocument, page_index: usize, font: PDType1Font, size: f64, ) -> &mut Self
pub fn set_truetype_font( &mut self, doc: &mut PDDocument, page_index: usize, font: &PDTrueTypeFont, size: f64, ) -> &mut Self
pub fn set_text_matrix( &mut self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64, ) -> &mut Self
pub fn set_leading(&mut self, leading: f64) -> &mut Self
pub fn move_text_position(&mut self, tx: f64, ty: f64) -> &mut Self
pub fn show_text(&mut self, text: &str) -> &mut Self
pub fn show_text_at(&mut self, text: &str, x: f64, y: f64) -> &mut Self
pub fn show_text_multiline( &mut self, lines: &[&str], x: f64, y: f64, leading: f64, ) -> &mut Self
pub fn draw_image( &mut self, image_name: &str, x: f64, y: f64, width: f64, height: f64, ) -> &mut Self
Sourcepub fn finish(self, doc: &mut PDDocument, page_index: usize) -> PdfResult<()>
pub fn finish(self, doc: &mut PDDocument, page_index: usize) -> PdfResult<()>
Flushes and applies the content stream to the document page.
Sourcepub fn finish_to_bytes(self) -> Vec<u8> ⓘ
pub fn finish_to_bytes(self) -> Vec<u8> ⓘ
Returns the raw byte buffer of this content stream.
Auto Trait Implementations§
impl Freeze for PDPageContentStream
impl RefUnwindSafe for PDPageContentStream
impl Send for PDPageContentStream
impl Sync for PDPageContentStream
impl Unpin for PDPageContentStream
impl UnsafeUnpin for PDPageContentStream
impl UnwindSafe for PDPageContentStream
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