Struct pdf_writer::Content[][src]

pub struct Content { /* fields omitted */ }
Expand description

Builder for a content stream.

Implementations

impl Content[src]

pub fn new() -> Self[src]

Create a new content stream with the default buffer capacity (currently 1 KB).

pub fn with_capacity(capacity: usize) -> Self[src]

Create a new content stream with the specified initial buffer capacity.

pub fn save_state(&mut self) -> &mut Self[src]

q: Save the graphics state on the stack.

pub fn restore_state(&mut self) -> &mut Self[src]

Q: Restore the graphics state from the stack.

pub fn matrix(
    &mut self,
    a: f32,
    b: f32,
    c: f32,
    d: f32,
    e: f32,
    f: f32
) -> &mut Self
[src]

cm: Modify the transformation matrix.

pub fn line_width(&mut self, width: f32) -> &mut Self[src]

w: Set the stroke line width.

Panics if width is negative.

pub fn line_cap(&mut self, cap: LineCapStyle) -> &mut Self[src]

J: Set the line cap style.

pub fn fill_rgb(&mut self, r: f32, g: f32, b: f32) -> &mut Self[src]

rg: Set the fill color to the parameter and the color space to DeviceRGB.

pub fn stroke_rgb(&mut self, r: f32, g: f32, b: f32) -> &mut Self[src]

RG: Set the stroke color to the parameter and the color space to DeviceRGB.

pub fn fill_cmyk(&mut self, c: f32, m: f32, y: f32, k: f32) -> &mut Self[src]

k: Set the fill color to the parameter and the color space to DeviceCMYK.

pub fn stroke_cmyk(&mut self, c: f32, m: f32, y: f32, k: f32) -> &mut Self[src]

K: Set the stroke color to the parameter and the color space to DeviceCMYK.

pub fn rect(
    &mut self,
    x: f32,
    y: f32,
    width: f32,
    height: f32,
    stroke: bool,
    fill: bool
) -> &mut Self
[src]

re: Draw a rectangle.

pub fn path(&mut self, stroke: bool, fill: bool) -> Path<'_>[src]

... h / S / f / B: Start drawing a bezier path.

pub fn text(&mut self) -> Text<'_>[src]

BT ... ET: Start writing a text object.

pub fn x_object(&mut self, name: Name<'_>) -> &mut Self[src]

Do: Write an external object.

pub fn finish(self) -> Vec<u8>[src]

Return the raw constructed byte stream.

Auto Trait Implementations

impl RefUnwindSafe for Content

impl Send for Content

impl Sync for Content

impl Unpin for Content

impl UnwindSafe for Content

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.