Class RGhost::Paper
In: paper.rb
Parent: RGhost::PsObject

Paper is the area where the Postscript elements/objects are drawn. The margin is the document‘s non-printable area (both by the cursors and by the page‘s internal controllers). The :area_x and :area_y are the printable section of the paper. It‘s used to configure definitions of paper. It automatically defined into Document by :paper parameter.

Methods

new   ps  

Included Modules

RGhost::RubyToPs

Constants

DEFAULT_OPTIONS = { :landscape => false, :margin_top => 1, :margin_right => 1, :margin_bottom => 1, :margin_left => 1, :duplex => false, :tumble => false

Public Class methods

Examples

Create paper by name

 doc=Document.new :paper => :A4

Create paper by name in landscape

 doc=Document.new :paper => :A4 , :landscape => true

Create custom paper

 doc=Document.new :paper => [10,15]

Defining all margins

 doc=Document.new :paper => :A5, :margin => 0.5

Defining custom margins

 doc=Document.new :paper => :A5, :margin => [0.5, 1, 0.5, 2]   #=>[top,right,bottom,left] clockwise

Defining particular margin

 doc=Document.new :paper => :A5, :margin_top => 1, :margin_left => 0.3

Defining two faces document to printer

 doc=Document.new :paper => :A5, :duplex => true

Parameters

  • paper - The paper parameter can be either a Symbol or a Array. If paper parameter is a Symbol its value will search in RGhost::Constants::Papers . If paper parameter is a Array(with two numeric elements) will be position [0] width and [1] height of page. Example:
     doc=Document.new :paper => :A3   #=> Build new A3 paper
     doc=Document.new :paper => [5,5] #=> Build new custom paper 5x5, using default unit defined in RGhost::Config::GS[:unit].
    

Configuration options:

  • :landscape - If set to true will invert width to height and height to width.
  • :margin - Specifies margins non-printable area. It can be one Numeric for all margins or Array [top,right,bottom,left] margins.
  • :duplex - Specifies two faces(for print)
  • :tumble - Specifies kind of duplex

Public Instance methods

[Validate]