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'
Commercial Use
Modify
Distribute
Place Warranty
Sub-License
Hold Liable
Distribute Original
Disclose Source
Include Copyright
State Changes
Include License
These details are provided for information only. No information here is legal advice and should not be used as such.