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.



4
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
# File 'lib/pdf/core/document_state.rb', line 4

def initialize(options)
  (options)

  if options[:template]
    if options[:print_scaling]
      @store = PDF::Core::ObjectStore.new(:template => options[:template], :print_scaling => options[:print_scaling])
    else
      @store = PDF::Core::ObjectStore.new(:template => options[:template])
    end
    @store.info.data.merge!(options[:info]) if options[:info]
  else
    if options[:print_scaling]
      @store = PDF::Core::ObjectStore.new(:info => options[:info], :print_scaling => options[:print_scaling])
    else
      @store = 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