Class: PDF::Core::DocumentState

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf/core/document_state.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ DocumentState

Returns a new instance of DocumentState.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/pdf/core/document_state.rb', line 5

def initialize(options)
  (options)

  if options[:template]
    @store =
      if options[:print_scaling]
        PDF::Core::ObjectStore.new(
          template: options[:template],
          print_scaling: options[:print_scaling]
        )
      else
        PDF::Core::ObjectStore.new(template: options[:template])
      end
    @store.info.data.merge!(options[:info]) if options[:info]
  else
    @store =
      if options[:print_scaling]
        PDF::Core::ObjectStore.new(
          info: options[:info],
          print_scaling: options[:print_scaling]
        )
      else
        PDF::Core::ObjectStore.new(info: options[:info])
      end
  end

  @version = 1.3
  @pages = []
  @page = nil
  @trailer = options.fetch(:trailer, {})
  @compress = options.fetch(:compress, false)
  @encrypt = options.fetch(:encrypt, false)
  @encryption_key = options[:encryption_key]
  @skip_encoding = options.fetch(:skip_encoding, false)
  @before_render_callbacks = []
  @on_page_create_callback = nil
end

Instance Method Details

#__initializeObject



4
# File 'lib/pdf/core/document_state.rb', line 4

alias __initialize initialize