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

Optional Configuration

By default, the variable RGhost::Config::GS[:path] has the content detected from your environment , but you must configure it if your gs binary is in another path. For example, in the Microsoft platform.

RGhost::Config::GS[:path]= "C:\\gs\\bin\\gswin32c.exe"

Listed below are the keys of the said hash.

:path

Path to executable Ghostscript.

RGhost::Config::GS[:path]="C:\\gs\\bin\\gswin32c.exe"

:tmpdir

Temporary directory

RGhost::Config::GS[:tmpdir] = ENV['TEMP']

:default_params

Allows you to add/remove options. (use with caution!)

RGhost::Config::GS[:default_params] << '-dSAFER'

:stack_elements

Defines the maximum number of elements for each matrix inside postscript’s internal stack, avoiding a stack overflow error.

RGhost::Config::GS[:stack_elements]=5000

:unit

Set the measure units. See Units::Unit for available units.

RGhost::Config::GS[:unit]=RGhost::Units::Cm

:charset_convert

Ruby to PS character conversion proxy. Necessary when the source code isn’t in the same encoding as the document.
Params is a block that returns a String. The default is below, to disable set it as nil.

RGhost::Config::GS[:charset_convert]=lambda {|text| Iconv::iconv('latin1','utf8', text)}

:font_encoding

Sets the Postscript font encoding. Default: :IsoLatin. This parameter can be enabled at the creation of the document.

RGhost::Config::GS[:font_encoding]= :IsoLatin

:extensions

Sets the options library path. Includes fonts and postscript codes.

RGhost::Config::GS[:extensions] << “/mydir”

:preload

Preloads library by file name, the system will search inside :extensions directories.

RGhost::Config::GS[:preload] << :mylib

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