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.


new   ps  

Included Modules



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

Public Class methods


Create paper by name :paper => :A4

Create paper by name in landscape :paper => :A4 , :landscape => true

Create custom paper :paper => [10,15]

Defining all margins :paper => :A5, :margin => 0.5

Defining custom margins :paper => :A5, :margin => [0.5, 1, 0.5, 2]   #=>[top,right,bottom,left] clockwise

Defining particular margin :paper => :A5, :margin_top => 1, :margin_left => 0.3

Defining two faces document to printer :paper => :A5, :duplex => true


  • 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: :paper => :A3   #=> Build new A3 paper :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