My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

Similar in approach (and based on) perl's PostScript::Simple.

Sample usage, importing and scaling an eps, drawing a line, adding text, and converting to pdf (from a program that uses pdftops in order to be able to arbitrarily draw on pdf pages).

ps = PostScript.new :orient => :portrait
ps.newpage
scale = [(ps.h - 25.0) / x1, ps.w * 1.0 / x2, 1].min
ps.importepsfile epsfn, (ps.w - x2 * scale) / 2, ((ps.h - 25) - x1 * scale) / 2 + 25, :scale => scale
ps.line 0, 25, ps.w, 25
ps.setfont 'Helvetica-Bold', 12
ps.text id, ps.w - 8,8, :align => :right
ps.to_pdf 'output.pdf'
Powered by Google Project Hosting