ExtGState

Struct ExtGState 

Source
pub struct ExtGState {
Show 27 fields pub line_width: Option<f64>, pub line_cap: Option<LineCap>, pub line_join: Option<LineJoin>, pub miter_limit: Option<f64>, pub dash_pattern: Option<LineDashPattern>, pub rendering_intent: Option<RenderingIntent>, pub overprint_stroke: Option<bool>, pub overprint_fill: Option<bool>, pub overprint_mode: Option<u8>, pub font: Option<ExtGStateFont>, pub black_generation: Option<TransferFunction>, pub black_generation_2: Option<TransferFunction>, pub undercolor_removal: Option<TransferFunction>, pub undercolor_removal_2: Option<TransferFunction>, pub transfer_function: Option<TransferFunction>, pub transfer_function_2: Option<TransferFunction>, pub halftone: Option<Halftone>, pub flatness: Option<f64>, pub smoothness: Option<f64>, pub stroke_adjustment: Option<bool>, pub blend_mode: Option<BlendMode>, pub soft_mask: Option<SoftMask>, pub alpha_stroke: Option<f64>, pub alpha_fill: Option<f64>, pub alpha_is_shape: Option<bool>, pub text_knockout: Option<bool>, pub use_black_point_compensation: Option<bool>,
}
Expand description

Extended Graphics State Dictionary according to ISO 32000-1 Section 8.4

Fields§

§line_width: Option<f64>

Line width (LW)

§line_cap: Option<LineCap>

Line cap style (LC)

§line_join: Option<LineJoin>

Line join style (LJ)

§miter_limit: Option<f64>

Miter limit (ML)

§dash_pattern: Option<LineDashPattern>

Line dash pattern (D)

§rendering_intent: Option<RenderingIntent>

Rendering intent (RI)

§overprint_stroke: Option<bool>

Overprint for stroking operations (OP)

§overprint_fill: Option<bool>

Overprint for non-stroking operations (op)

§overprint_mode: Option<u8>

Overprint mode (OPM)

§font: Option<ExtGStateFont>

Font and size (Font)

§black_generation: Option<TransferFunction>

Black generation function (BG)

§black_generation_2: Option<TransferFunction>

Black generation function alternative (BG2)

§undercolor_removal: Option<TransferFunction>

Undercolor removal function (UCR)

§undercolor_removal_2: Option<TransferFunction>

Undercolor removal function alternative (UCR2)

§transfer_function: Option<TransferFunction>

Transfer function (TR)

§transfer_function_2: Option<TransferFunction>

Transfer function alternative (TR2)

§halftone: Option<Halftone>

Halftone dictionary (HT)

§flatness: Option<f64>

Flatness tolerance (FL)

§smoothness: Option<f64>

Smoothness tolerance (SM)

§stroke_adjustment: Option<bool>

Automatic stroke adjustment (SA)

§blend_mode: Option<BlendMode>

Blend mode (BM)

§soft_mask: Option<SoftMask>

Soft mask (SMask)

§alpha_stroke: Option<f64>

Alpha constant for stroking (CA)

§alpha_fill: Option<f64>

Alpha constant for non-stroking (ca)

§alpha_is_shape: Option<bool>

Alpha source flag (AIS)

§text_knockout: Option<bool>

Text knockout flag (TK)

§use_black_point_compensation: Option<bool>

Black point compensation (UseBlackPtComp)

Implementations§

Source§

impl ExtGState

Source

pub fn new() -> Self

Create a new empty ExtGState dictionary

Source

pub fn with_line_width(self, width: f64) -> Self

Set line width

Source

pub fn with_line_cap(self, cap: LineCap) -> Self

Set line cap style

Source

pub fn with_line_join(self, join: LineJoin) -> Self

Set line join style

Source

pub fn with_miter_limit(self, limit: f64) -> Self

Set miter limit

Source

pub fn with_dash_pattern(self, pattern: LineDashPattern) -> Self

Set line dash pattern

Source

pub fn with_rendering_intent(self, intent: RenderingIntent) -> Self

Set rendering intent

Source

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

Set overprint for stroking operations

Source

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

Set overprint for non-stroking operations

Source

pub fn with_overprint_mode(self, mode: u8) -> Self

Set overprint mode

Source

pub fn with_font(self, font: Font, size: f64) -> Self

Set font and size

Source

pub fn with_flatness(self, flatness: f64) -> Self

Set flatness tolerance

Source

pub fn with_smoothness(self, smoothness: f64) -> Self

Set smoothness tolerance

Source

pub fn with_stroke_adjustment(self, adjustment: bool) -> Self

Set automatic stroke adjustment

Source

pub fn with_blend_mode(self, mode: BlendMode) -> Self

Set blend mode

Source

pub fn with_alpha_stroke(self, alpha: f64) -> Self

Set alpha constant for stroking operations

Source

pub fn with_alpha_fill(self, alpha: f64) -> Self

Set alpha constant for non-stroking operations

Source

pub fn with_alpha(self, alpha: f64) -> Self

Set alpha constant for both stroking and non-stroking operations

Source

pub fn with_alpha_is_shape(self, is_shape: bool) -> Self

Set alpha source flag

Source

pub fn with_text_knockout(self, knockout: bool) -> Self

Set text knockout flag

Source

pub fn set_soft_mask(&mut self, mask: SoftMask)

Set soft mask for transparency

Source

pub fn set_soft_mask_name(&mut self, name: String)

Set soft mask with a named XObject

Source

pub fn set_soft_mask_none(&mut self)

Remove soft mask (set to None)

Source

pub fn with_black_point_compensation(self, use_compensation: bool) -> Self

Set black point compensation (PDF 2.0)

Source

pub fn with_transfer_function(self, func: TransferFunction) -> Self

Set transfer function for output device gamma correction

Source

pub fn with_gamma_correction(self, gamma: f64) -> Self

Set gamma correction transfer function

Source

pub fn with_linear_transfer(self, slope: f64, intercept: f64) -> Self

Set linear transfer function with slope and intercept

Source

pub fn with_transfer_function_2(self, func: TransferFunction) -> Self

Set alternative transfer function (TR2)

Source

pub fn with_black_generation(self, func: TransferFunction) -> Self

Set black generation function

Source

pub fn with_undercolor_removal(self, func: TransferFunction) -> Self

Set undercolor removal function

Source

pub fn uses_transparency(&self) -> bool

Check if any transparency parameters are set

Source

pub fn to_pdf_dictionary(&self) -> Result<String>

Generate PDF dictionary representation

Source

pub fn is_empty(&self) -> bool

Check if the ExtGState is empty (no parameters set)

Source

pub fn to_dict(&self) -> Dictionary

Convert to Dictionary object for PDF writer

Trait Implementations§

Source§

impl Clone for ExtGState

Source§

fn clone(&self) -> ExtGState

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExtGState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExtGState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more