Struct pdf_writer::writers::ExtGraphicsState

source ·
pub struct ExtGraphicsState<'a> { /* private fields */ }
Expand description

Writer for a dictionary with additional parameters for the graphics state.

This struct is created by Chunk::ext_graphics and ShadingPattern::ext_graphics.

Implementations§

source§

impl<'a> ExtGraphicsState<'a>

source

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

Write the LW attribute to set the line width. PDF 1.3+.

source

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

Write the LC attribute to set the line cap style. PDF 1.3+.

source

pub fn line_join(&mut self, join: LineJoinStyle) -> &mut Self

Write the LJ attribute to set the line join style. PDF 1.3+.

source

pub fn miter_limit(&mut self, limit: f32) -> &mut Self

Write the ML attribute to set the miter limit. PDF 1.3+.

source

pub fn dash_pattern( &mut self, pattern: impl IntoIterator<Item = f32>, phase: f32 ) -> &mut Self

Write the D attribute to set the dash pattern. PDF 1.3+.

source

pub fn rendering_intent(&mut self, intent: RenderingIntent) -> &mut Self

Write the RI attribute to set the rendering intent. PDF 1.3+.

source

pub fn overprint(&mut self, overprint: bool) -> &mut Self

Write the OP attribute to set the overprint mode for all operations, except if an op entry is present. If so, only influence the stroking operations. PDF 1.2+.

source

pub fn overprint_fill(&mut self, overprint: bool) -> &mut Self

Write the op attribute to set the overprint mode for fill operations. PDF 1.3+.

source

pub fn overprint_mode(&mut self, mode: OverprintMode) -> &mut Self

Write the OPM attribute to set the overprint mode for components that have been zeroed out. PDF 1.3+.

source

pub fn font(&mut self, font: Name<'_>, size: f32) -> &mut Self

Write the Font attribute to set the font. PDF 1.3+.

source

pub fn black_generation(&mut self, func: Ref) -> &mut Self

Write the BG attribute to set the black generation function.

source

pub fn black_generation_default(&mut self) -> &mut Self

Write the BG2 attribute to set the black-generation function back to the function that has been in effect at the beginning of the page. PDF 1.3+.

source

pub fn undercolor_removal(&mut self, func: Ref) -> &mut Self

Write the UCR attribute to set the undercolor removal function.

source

pub fn undercolor_removal_default(&mut self) -> &mut Self

Write the UCR2 attribute to set the undercolor removal function back to the function that has been in effect at the beginning of the page. PDF 1.3+.

source

pub fn transfer(&mut self, func: Ref) -> &mut Self

Write the TR attribute to set the transfer function.

source

pub fn transfer_default(&mut self) -> &mut Self

Write the TR2 attribute to set the transfer function back to the function that has been in effect at the beginning of the page. PDF 1.3+.

source

pub fn halftone(&mut self, ht: Ref) -> &mut Self

Write the HT attribute to set the halftone.

source

pub fn halftone_default(&mut self) -> &mut Self

Write the HT attribute to set the halftone back to the one that has been in effect at the beginning of the page.

source

pub fn flatness(&mut self, tolerance: f32) -> &mut Self

Write the FL attribute to set the flatness tolerance. PDF 1.3+.

source

pub fn smoothness(&mut self, tolerance: f32) -> &mut Self

Write the SM attribute to set the smoothness tolerance. PDF 1.3+.

source

pub fn stroke_adjustment(&mut self, adjust: bool) -> &mut Self

Write the SA attribute to set automatic stroke adjustment.

source

pub fn blend_mode(&mut self, mode: BlendMode) -> &mut Self

Write the BM attribute to set the blend mode. PDF 1.4+.

source

pub fn soft_mask(&mut self) -> SoftMask<'_>

Start writing the SMask attribute. PDF 1.4+.

source

pub fn soft_mask_name(&mut self, mask: Name<'_>) -> &mut Self

Write the SMask attribute using a name. PDF 1.4+.

source

pub fn stroking_alpha(&mut self, alpha: f32) -> &mut Self

Write the CA attribute to set the stroking alpha constant. PDF 1.4+.

source

pub fn non_stroking_alpha(&mut self, alpha: f32) -> &mut Self

Write the ca attribute to set the non-stroking alpha constant. PDF 1.4+.

source

pub fn alpha_source(&mut self, source: bool) -> &mut Self

Write the AIS attribute to set the alpha source flag. CA and ca values as well as the SMask will be interpreted as shape instead of opacity. PDF 1.4+.

source

pub fn text_knockout(&mut self, knockout: bool) -> &mut Self

Write the TK attribute to set the text knockout flag. PDF 1.4+.

Methods from Deref<Target = Dict<'a>>§

source

pub fn len(&self) -> i32

The number of written pairs.

source

pub fn is_empty(&self) -> bool

Whether no pairs have been written so far.

source

pub fn insert(&mut self, key: Name<'_>) -> Obj<'_>

Start writing a pair with an arbitrary value.

source

pub fn pair<T: Primitive>(&mut self, key: Name<'_>, value: T) -> &mut Self

Write a pair with a primitive value.

This is a shorthand for dict.insert(key).primitive(value).

source

pub fn pairs<'n, T: Primitive>( &mut self, pairs: impl IntoIterator<Item = (Name<'n>, T)> ) -> &mut Self

Write a sequence of pairs with primitive values.

Trait Implementations§

source§

impl<'a> Deref for ExtGraphicsState<'a>

§

type Target = Dict<'a>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a> DerefMut for ExtGraphicsState<'a>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'a, 'any> Rewrite<'a> for ExtGraphicsState<'any>

§

type Output = ExtGraphicsState<'a>

The writer with the rewritten lifetime.
source§

impl<'a> Writer<'a> for ExtGraphicsState<'a>

source§

fn start(obj: Obj<'a>) -> Self

Start writing the object.

Auto Trait Implementations§

§

impl<'a> Freeze for ExtGraphicsState<'a>

§

impl<'a> RefUnwindSafe for ExtGraphicsState<'a>

§

impl<'a> Send for ExtGraphicsState<'a>

§

impl<'a> Sync for ExtGraphicsState<'a>

§

impl<'a> Unpin for ExtGraphicsState<'a>

§

impl<'a> !UnwindSafe for ExtGraphicsState<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Finish for T

source§

fn finish(self)

Does nothing but move self, equivalent to drop.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.