Class RGhost::TextIn
In: text_in.rb
Parent: RGhost::PsObject

TextIn is a helper to combine the cursor positioning and text output into one step.

Methods

new   ps  

Included Modules

RGhost::RubyToPs

Constants

DEFAULT_OPTIONS = {:x=> :limit_left,:y=> :current_row, :tag => :default_font, :write => "Ruby Ghost API - current_row = %row% "}

Public Class methods

Options

  • :x and :y - Initial position.
  • :tag or :with - Use predefined tag.
  • :color - Override color of the tag.
  • :text or :write - The text.

Examples

 doc=RGhost::Document.new
 doc.text_in :x => 3, :y => 4, :write => "Foo Bar Baz", :tag => :h1

Rotating

 doc.newpath do
  translate :x => 3, :y=> 4
   rotate 45
   text_in :x => 0, :y => 0, :write => "Foo Bar Baz1", :tag => :font2
 end

Eval postscript internal

TextIn will eval postscript internal variables you pass in between % signs. Sounds complex, huh? Let‘s see an example:

 doc.text_in :x=> 3.5, :y=> 5.5, :text => "this is %row% row and current page %current_page%"

Public Instance methods

[Validate]