shairontoledo / rghost

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)
http://rghost.rubyforge.org
MIT License
187 stars 46 forks source link

Converting Pixel to Point #58

Closed leenasn closed 10 years ago

leenasn commented 10 years ago

Hi,

I am developing an application where I need to provide an option to the user for designing in the browser i.e. user can upload an art work and customise the same by adding text etc. Once the user is done with the design, the application should create a PDF which can be used by vendors for printing.

We are using RGhost for creating the PDF file, but has the following questions:

Hope these question makes sense. Please let me know if am missing anything.

Thanks, Leena

shairontoledo commented 10 years ago

On point in postscript is equivalent to 1/72.27 in (= 2540/7227 mm ~ 0.35145980351 mm), you can create a class like this one http://www.ruby-doc.org/gems/docs/l/lunks_rghost-0.8.7.6/RGhost/Units/Cm.html that has postscript conversion code and so set the unit you want with RGhost::Config::GS[:unit] like this https://github.com/shairontoledo/rghost/wiki/Units

shairontoledo commented 10 years ago

Configure your fonts or load .ttf config or sorta with :from when defining tags https://github.com/shairontoledo/rghost/wiki/defining-and-using-tags

shairontoledo commented 10 years ago

Didn't get

What setting should we use so that the canvas size is set to a standard and make sure that the design is fit into that canvas size?