Represents a PDF Extended Graphics State (ExtGState) dictionary.
Extended graphics states allow setting graphics state parameters
that cannot be set directly in a content stream, such as:
- Transparency (fill and stroke opacity)
- Blend modes
- Overprint settings
- Line width, cap, join as resources
Usage
# Create an ExtGState for 50% transparency
gs = PDF::Objects::ExtGState.new
gs.fill_opacity = 0.5
gs.stroke_opacity = 0.5
gs.blend_mode = PDF::Content::GraphicsState::BlendMode::Multiply
# Use in page:
page.set_graphics_state(gs)
Constants
TYPE = Name.new("ExtGState")
Constructors
with_blend_mode(mode : Content::GraphicsState::BlendMode) : ExtGState
Creates an ExtGState with a blend mode.
Sourcewith_opacity(fill :
Float64 |
Nil = nil, stroke :
Float64 |
Nil = nil) :
ExtGState Creates an ExtGState with common opacity settings.
SourceInstance methods
alpha_is_shape=(alpha_is_shape :
Bool |
Nil)
Sourceblend_mode=(blend_mode : Content::GraphicsState::BlendMode | Nil)
Sourcedash_pattern=(dash_pattern : Content::GraphicsState::DashPattern | Nil)
Sourcefill_opacity
Fill (non-stroking) opacity (CA/ca) - 0.0 to 1.0
Sourcefill_opacity=(fill_opacity :
Float64 |
Nil)
Fill (non-stroking) opacity (CA/ca) - 0.0 to 1.0
Sourcefill_overprint=(fill_overprint :
Bool |
Nil)
Sourcehash_key
Generates a unique key based on the state's properties.
Used for deduplication and resource naming.
Sourceline_cap=(line_cap : Content::GraphicsState::LineCap | Nil)
Sourceline_join=(line_join : Content::GraphicsState::LineJoin | Nil)
Sourceoverprint_mode
Overprint mode (OPM) - 0 or 1
Sourceoverprint_mode=(overprint_mode :
Int32 |
Nil)
Overprint mode (OPM) - 0 or 1
Sourcerendering_intent=(rendering_intent : Content::GraphicsState::RenderingIntent | Nil)
Sourcesoft_mask
Soft mask (SMask) - Name or dictionary
Sourcesoft_mask=(soft_mask : Base | Nil)
Soft mask (SMask) - Name or dictionary
Sourcestroke_opacity
Stroke opacity (CA) - 0.0 to 1.0
Sourcestroke_opacity=(stroke_opacity :
Float64 |
Nil)
Stroke opacity (CA) - 0.0 to 1.0
Sourcestroke_overprint=(stroke_overprint :
Bool |
Nil)
Sourcetext_knockout=(text_knockout :
Bool |
Nil)
Sourceto_dictionary
Converts to a PDF dictionary.
SourceSerializes this object to an IO.
By default, this writes the result of #to_pdf to the IO.
Subclasses may override for more efficient streaming.
Sourceto_pdf
Serializes this object to PDF syntax.
Returns the PDF representation as a string.
Source