class Hpdf::ExtGState

Overview

An extended graphics state object controls transparency and blend modes for page content. Create one with Doc#create_ext_g_state, configure it, then apply it to a page with Page#ext_g_state=.

gs = doc.create_ext_g_state
gs.alpha_fill = 0.5
gs.blend_mode = Hpdf::BlendMode::Multiply
page.ext_g_state = gs

Included Modules

Defined in:

hpdf/ext_g_state.cr

Constructors

Instance Method Summary

Instance methods inherited from module Hpdf::Helper

bool(val : Bool) : Int32 bool, nilable_str(v : Pointer(UInt8)) : String | Nil nilable_str, real(val : Number) : LibHaru::Real real, uint(val : Number) : LibHaru::UInt uint, uint16(val : Number) : UInt16 uint16

Constructor Detail

def self.new(ext_g_state : LibHaru::ExtGState, doc : Doc) #

[View source]

Instance Method Detail

def alpha_fill=(value : Number) #

sets the fill alpha (opacity) of the graphics state. value must be between 0.0 (fully transparent) and 1.0 (fully opaque).


[View source]
def alpha_stroke=(value : Number) #

sets the stroke alpha (opacity) of the graphics state. value must be between 0.0 (fully transparent) and 1.0 (fully opaque).


[View source]
def blend_mode=(mode : BlendMode) #

sets the blend mode of the graphics state. The blend mode controls how painted content is composited with the existing page content. See BlendMode for available modes.


[View source]
def to_unsafe : LibHaru::ExtGState #

[View source]