Module: FN::PDF::Node

Included in:
Writer
Defined in:
lib/fn/pdf/node/invert.rb,
lib/fn/pdf/node/open_pdi.rb,
lib/fn/pdf/node/fit_image.rb,
lib/fn/pdf/node/watermark.rb,
lib/fn/pdf/node/load_image.rb,
lib/fn/pdf/node/resume_page.rb,
lib/fn/pdf/node/end_page_ext.rb,
lib/fn/pdf/node/fit_pdi_page.rb,
lib/fn/pdf/node/fit_textflow.rb,
lib/fn/pdf/node/open_pdi_page.rb,
lib/fn/pdf/node/set_parameter.rb,
lib/fn/pdf/node/begin_document.rb,
lib/fn/pdf/node/begin_page_ext.rb,
lib/fn/pdf/node/create_textflow.rb

Defined Under Namespace

Modules: BeginDocument, BeginPageExt, CreateTextflow, EndPageExt, FitImage, FitPdiPage, FitTextflow, Invert, LoadImage, OpenPdi, OpenPdiPage, ResumePage, SetParameter, Watermark

Instance Method Summary collapse

Instance Method Details

#BeginDocument(file, compatibility) ⇒ Object



7
8
9
# File 'lib/fn/pdf/node/begin_document.rb', line 7

def BeginDocument(file, compatibility)
  FN::Node::Base("begin_document", :file => file, :compatibility => compatibility).extend(BeginDocument)
end

#BeginPageExt(width, height, number) ⇒ Object



7
8
9
# File 'lib/fn/pdf/node/begin_page_ext.rb', line 7

def BeginPageExt(width, height, number)
  FN::Node::Base("begin_page_ext", :width => width, :height => height, :number => number).extend(BeginPageExt)
end

#CreateTextflow(node) ⇒ Object



6
7
8
9
10
# File 'lib/fn/pdf/node/create_textflow.rb', line 6

def CreateTextflow(node)
  out = FN::Node::Base("create_textflow", :assigns => CreateTextflow.flow_name(node))
  out << XML::Node.new_cdata(CreateTextflow.format(node))
  out.extend(CreateTextflow)
end

#EndPageExt(number) ⇒ Object



7
8
9
# File 'lib/fn/pdf/node/end_page_ext.rb', line 7

def EndPageExt(number)
  FN::Node::Base("end_page_ext", :pagenumber => number).extend(EndPageExt)
end

#FitImage(image, x, y, opts = {}) ⇒ Object



6
7
8
# File 'lib/fn/pdf/node/fit_image.rb', line 6

def FitImage(image, x, y, opts = {})
  FN::Node::Base("fit_image", opts.merge(:image => image, :x => x, :y => y)).extend(FitImage)
end

#FitPdiPage(var) ⇒ Object



6
7
8
# File 'lib/fn/pdf/node/fit_pdi_page.rb', line 6

def FitPdiPage(var)
  FN::Node::Base("fit_pdi_page", :page => var)
end

#FitTextflow(flow, block) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/fn/pdf/node/fit_textflow.rb', line 6

def FitTextflow(flow, block)
  FN::Node::Base("fit_textflow", :flow => "{#{flow && flow.flow_name}}", 
        :x  => block["x"], 
        :y  => block["y"],
        :x2 => block["x"].to_f + block["width"].to_f,
        :y2 => block["y"].to_f + block["height"].to_f
      ).extend(FitTextflow)
end

#Invert(block) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/fn/pdf/node/invert.rb', line 14

def Invert(block)
  FN::Node::Base("invert", 
        :x  => block["x"], 
        :y  => block["y"],
        :x2 => block["x"].to_f + block["width"].to_f,
        :y2 => block["y"].to_f + block["height"].to_f
      ).extend(Invert)
end

#LoadImage(file, var) ⇒ Object



6
7
8
# File 'lib/fn/pdf/node/load_image.rb', line 6

def LoadImage(file, var)
  FN::Node::Base("load_image", :file => file, :assigns => var).extend(LoadImage)
end

#OpenPdi(file, var) ⇒ Object



6
7
8
# File 'lib/fn/pdf/node/open_pdi.rb', line 6

def OpenPdi(file, var)
  FN::Node::Base("open_pdi", :file => file, :assigns => var).extend(OpenPdi)
end

#OpenPdiPage(pdi_var, page_number, page_var) ⇒ Object



7
8
9
# File 'lib/fn/pdf/node/open_pdi_page.rb', line 7

def OpenPdiPage(pdi_var, page_number, page_var)
  FN::Node::Base("open_pdi_page", :pdi => pdi_var, :number => page_number, :assigns => page_var).extend(OpenPdiPage)
end

#ResumePage(number) ⇒ Object



6
7
8
# File 'lib/fn/pdf/node/resume_page.rb', line 6

def ResumePage(number)
  FN::Node::Base("resume_page", :pagenumber => number).extend(ResumePage)
end

#SetParameter(key, value) ⇒ Object



7
8
9
# File 'lib/fn/pdf/node/set_parameter.rb', line 7

def SetParameter(key, value)
  FN::Node::Base("set_parameter", :key => key, :value => value).extend(SetParameter)
end

#Watermark(text) ⇒ Object



7
8
9
# File 'lib/fn/pdf/node/watermark.rb', line 7

def Watermark(text)
  FN::Node::Base("watermark", :text => text).extend(Watermark)
end