Method: PDF::Core::Page#initialize
- Defined in:
- lib/pdf/core/page.rb
#initialize(document, options = {}) ⇒ Page
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Page.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/pdf/core/page.rb', line 84 def initialize(document, = {}) @document = document @margins = [:margins] || { left: 36, right: 36, top: 36, bottom: 36, } @crops = [:crops] || ZERO_INDENTS @bleeds = [:bleeds] || ZERO_INDENTS @trims = [:trims] || ZERO_INDENTS @art_indents = [:art_indents] || ZERO_INDENTS @stack = GraphicStateStack.new([:graphic_state]) @size = [:size] || 'LETTER' @layout = [:layout] || :portrait @stamp_stream = nil @stamp_dictionary = nil @content = document.ref({}) content << 'q' << "\n" @dictionary = document.ref( Type: :Page, Parent: document.state.store.pages, MediaBox: dimensions, CropBox: crop_box, BleedBox: bleed_box, TrimBox: trim_box, ArtBox: art_box, Contents: content, ) resources[:ProcSet] = i[PDF Text ImageB ImageC ImageI] end |