class Origami::Page
Constants
- Activation
- Animation
- Asset
- Assets
- Binding
- C
- Condition
- Configuration
- Configurations
- Contents
- Deactivation
- FlashVars
- Instances
- NA
- Names
- O
- PA
- Params
- PassContextClick
- Presentation
- Resources
- RichMediaContent
- RichMediaSettings
- Style
- Subtype
- Toolbar
- Transparent
Public Class Methods
Origami::Dictionary::new
# File lib/origami/page.rb, line 570 def initialize(hash = {}, parser = nil) super(hash, parser) set_indirect(true) end
Public Instance Methods
Add an Annotation
to the Page
.
# File lib/origami/page.rb, line 613 def add_annotation(*annotations) unless annotations.all?{|annot| annot.is_a?(Annotation) or annot.is_a?(Reference)} raise TypeError, "Only Annotation objects must be passed." end self.Annots ||= [] annotations.each do |annot| annot.solve[:P] = self if self.indirect? self.Annots << annot end end
Embed a SWF Flash application in the page.
# File lib/origami/page.rb, line 650 def add_flash_application(swfspec, params = {}) options = { windowed: false, transparent: false, navigation_pane: false, toolbar: false, pass_context_click: false, activation: Annotation::RichMedia::Activation::PAGE_OPEN, deactivation: Annotation::RichMedia::Deactivation::PAGE_CLOSE, flash_vars: nil } options.update(params) annot = create_richmedia(:Flash, swfspec, options) add_annotation(annot) annot end
Returns the array of Annotation
objects of the Page
.
# File lib/origami/page.rb, line 643 def annotations self.each_annotation.to_a end
TODO :nodoc:
# File lib/origami/graphics/xobject.rb, line 464 def draw_image raise NotImplementedError end
# File lib/origami/graphics/xobject.rb, line 469 def draw_line(from, to, attr = {}) last_content_stream.draw_line(from, to, attr); self end
See ContentStream#draw_polygon
.
# File lib/origami/graphics/xobject.rb, line 474 def draw_polygon(coords = [], attr = {}) last_content_stream.draw_polygon(coords, attr); self end
See ContentStream#draw_rectangle
.
# File lib/origami/graphics/xobject.rb, line 479 def draw_rectangle(x, y, width, height, attr = {}) last_content_stream.draw_rectangle(x, y, width, height, attr); self end
Iterate through each Annotation
of the Page
.
# File lib/origami/page.rb, line 629 def each_annotation annots = self.Annots return enum_for(__method__) { annots.is_a?(Array) ? annots.length : 0 } unless block_given? return unless annots.is_a?(Array) annots.each do |annot| yield(annot.solve) end end
Iterates over all the ContentStreams of the Page
.
# File lib/origami/page.rb, line 585 def each_content_stream contents = self.Contents return enum_for(__method__) do case contents when Array then contents.length when Stream then 1 else 0 end end unless block_given? case contents when Stream then yield(contents) when Array then contents.each { |stm| yield(stm.solve) } end end
Will execute an action when the page is closed.
# File lib/origami/page.rb, line 687 def onClose(action) unless action.is_a?(Action) or action.is_a?(Reference) raise TypeError, "An Action object must be passed." end self.AA ||= Page::AdditionalActions.new self.AA.C = action self end
Will execute an action when the page is opened.
# File lib/origami/page.rb, line 673 def onOpen(action) unless action.is_a?(Action) or action.is_a?(Reference) raise TypeError, "An Action object must be passed." end self.AA ||= Page::AdditionalActions.new self.AA.O = action self end
TODO :nodoc:
# File lib/origami/graphics/xobject.rb, line 489 def paint_shading(shade) last_content_stream.paint_shading(shade) end
Origami::Object#pre_build
# File lib/origami/page.rb, line 576 def pre_build self.Resources = Resources.new.pre_build unless self.has_key?(:Resources) super end
See ContentStream#set_dash_pattern
.
# File lib/origami/graphics/xobject.rb, line 544 def set_dash_pattern(pattern) last_content_stream.set_dash_pattern(pattern); self end
See ContentStream#set_fill_color
.
# File lib/origami/graphics/xobject.rb, line 534 def set_fill_color(color) last_content_stream.set_fill_color(color); self end
See ContentStream#set_line_cap
.
# File lib/origami/graphics/xobject.rb, line 554 def set_line_cap(cap) last_content_stream.set_line_cap(cap); self end
See ContentStream#set_line_join
.
# File lib/origami/graphics/xobject.rb, line 559 def set_line_join(join) last_content_stream.set_line_join(join); self end
See ContentStream#set_line_width
.
# File lib/origami/graphics/xobject.rb, line 549 def set_line_width(width) last_content_stream.set_line_width(width); self end
See ContentStream#set_stroke_color
.
# File lib/origami/graphics/xobject.rb, line 539 def set_stroke_color(color) last_content_stream.set_stroke_color(color); self end
See ContentStream#set_text_char_spacing
.
# File lib/origami/graphics/xobject.rb, line 529 def set_text_char_spacing(char_spacing) last_content_stream.set_text_char_spacing(char_spacing); self end
TODO :nodoc:
# File lib/origami/graphics/xobject.rb, line 494 def set_text_font(_font, _size) raise NotImplementedError end
See ContentStream#set_text_leading
.
# File lib/origami/graphics/xobject.rb, line 504 def set_text_leading(leading) last_content_stream.set_text_leading(leading); self end
See ContentStream#set_text_pos
.
# File lib/origami/graphics/xobject.rb, line 499 def set_text_pos(tx, ty) last_content_stream.set_text_pos(tx, ty); self end
See ContentStream#set_text_rendering
.
# File lib/origami/graphics/xobject.rb, line 509 def set_text_rendering(rendering) last_content_stream.set_text_rendering(rendering); self end
See ContentStream#set_text_rise
.
# File lib/origami/graphics/xobject.rb, line 514 def set_text_rise(rise) last_content_stream.set_text_rise(rise); self end
See ContentStream#set_text_scale
.
# File lib/origami/graphics/xobject.rb, line 519 def set_text_scale(scaling) last_content_stream.set_text_scale(scaling); self end
See ContentStream#set_text_word_spacing
.
# File lib/origami/graphics/xobject.rb, line 524 def set_text_word_spacing(word_spacing) last_content_stream.set_text_word_spacing(word_spacing); self end
See ContentStream#write
.
# File lib/origami/graphics/xobject.rb, line 484 def write(text, attr = {}) last_content_stream.write(text, attr); self end