Class: Pdfrb::Action::SetOCGState

Inherits:
Base
  • Object
show all
Defined in:
lib/pdfrb/action/types.rb

Overview

SetOCGState — toggle optional-content groups. §12.6.4.13

Class Method Summary collapse

Methods inherited from Base

register_as

Class Method Details

.action_typeObject



138
# File 'lib/pdfrb/action/types.rb', line 138

def action_type; :SetOCGState; end

.to_pdf(state:, preserve_rb: false) ⇒ Object



140
141
142
143
144
# File 'lib/pdfrb/action/types.rb', line 140

def to_pdf(state:, preserve_rb: false)
  payload = { S: :SetOCGState, State: state }
  payload[:PreserveRB] = preserve_rb unless preserve_rb == false
  payload
end