Class Origami::Page
In: sources/parser/page.rb
Parent: Dictionary

Class representing a Page in the PDF document.

Methods

add_annot   new   onClose   onOpen   pre_build  

Included Modules

Configurable

Constants

Resources = Resources.new.pre_build unless has_field?(:Resources)
P = self if is_indirect?
O = action
C = action

Public Class methods

[Source]

     # File sources/parser/page.rb, line 283
283:     def initialize(hash = {})
284:       super(hash)
285:       
286:       set_indirect(true)
287:     end

Public Instance methods

Add an Annotation to the Page.

[Source]

     # File sources/parser/page.rb, line 298
298:     def add_annot(*annotations)
299:       
300:       unless annotations.all?{|annot| annot.is_a?(Annotation::Annotation)}
301:         raise TypeError, "An Annotation object must be passed."
302:       end
303:       
304:       self.Annots ||= Array.new
305:       annotations.each do |annot| 
306:         annot.P = self if is_indirect?
307:         self.Annots << annot 
308:       end
309:     end

[Source]

     # File sources/parser/page.rb, line 323
323:     def onClose(action)
324:       
325:       unless action.is_a?(Action::Action)
326:         raise TypeError, "An Action object must be passed."
327:       end
328:       
329:       self.AA ||= PageAdditionalActions.new
330:       self.AA.C = action
331:       
332:     end

[Source]

     # File sources/parser/page.rb, line 311
311:     def onOpen(action)
312:       
313:       unless action.is_a?(Action::Action)
314:         raise TypeError, "An Action object must be passed."
315:       end
316:       
317:       self.AA ||= PageAdditionalActions.new
318:       self.AA.O = action
319:       
320:       self
321:     end

[Source]

     # File sources/parser/page.rb, line 289
289:     def pre_build
290:       self.Resources = Resources.new.pre_build unless has_field?(:Resources)
291: 
292:       super
293:     end

[Validate]