Method: PDF::Core::ObjectStore#initialize

Defined in:
lib/pdf/core/object_store.rb

#initialize(opts = {}) ⇒ ObjectStore

Returns a new instance of ObjectStore.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/pdf/core/object_store.rb', line 5

def initialize(opts = {})
  @objects = {}
  @identifiers = []

  load_file(opts[:template]) if opts[:template]

  @info ||= ref(opts[:info] || {}).identifier
  @root ||= ref(Type: :Catalog).identifier
  if opts[:print_scaling] == :none
    root.data[:ViewerPreferences] = { PrintScaling: :None }
  end
  if pages.nil?
    root.data[:Pages] = ref(Type: :Pages, Count: 0, Kids: [])
  end
end