public
Description: RGhost is a document creation and conversion API. It uses the Ghostscript framework for the format conversion, utilizes EPS templates and is optimized to work with larger documents. Support(PDF,PS,GIF,TIF,PNG,JPG,etc)
Home | Edit | New

Units

The postscript default unit is 1 pixel/72 inch. RGhost uses centimeters (cm) as its default, mainly for positioning coordinates and numeric object sizes (if the size is a String, it won’t be parsed to the default unit).

This setting can be changed setting the value of RGhost::Config::GS[:unit] before the document is created using any of the Units child classes. Example:

Setting to inches.

RGhost::Config::GS[:unit]=Units::Inch
doc=RGhost::Document.new
doc.moveto :x => 1, :y => 2  #1 inch  x e 2 inches  y

Explicitly setting to Cm.
doc.moveto :x => '1 cm' , :y => '2 cm'

or using the Postscript unit
doc.moveto :x => '100' , :y => '200'

Last edited by shairontoledo, Mon Dec 22 03:51:01 -0800 2008
Home | Edit | New
Versions: