KDM_PS
Name
KDM_PS
Purpose
Make producing PostScript images easier. And PDF, PNG, etc. The
primary benefit is that PS images take up a full page in Portrait
or Landscape mode. Also simplifies creation of PDF and PNG from
PS, so the PNG images can be high quality and anti-aliased.
Category
Imaging
Calling Sequence
KDM_PS
Keyword Parameters
Anything that DEVICE accepts, plus...
LANDSCAPE: Set this keyword to produce images in Landscape mode
PORTRAIT: Set to produce images in portrait mode
CLOSE: Call with /CLOSE to finish producing the image
PDF: Call with /PDF to convert the postscript to PDF
CROP: Set this to crop the whitespace around any image
PNG: Set this to produce a PNG from the Postscript
SHOW: Set this to show the file (PDF or PNG) once produced
LOW: Set this to produce a low-quality (small size) PDF file
ROTATE: Set this to rotate the image by 90 degrees
Outputs
This procedure produces a PostScript file in the current directory
(unless the name encodes a different directory).
Optional Outputs
A PDF and/or PNG may also be produced.
Side Effects
Files are produced in the current folder
Restrictions
* Must have write access to the current folder.
* Many parts of this code are written specifically for an OS X
computer with the following programs installed: pstopdf,
pdfcrop, sips, gm (graphicsmagick). These are only used if /PDF,
/CROP, /LOW, /PNG, or /ROTATE are used. The basic PS production
should work on any computer.
Example
kdm_ps, /landscape, filename='kdm_ps_test.ps'
plot, [0,0], [1,1], position=[0,0,1,1]
xyouts, 0.5, 0.5, 'Hello World', align=0.5, charsize=3, charth=3
kdm_ps, /close, /pdf, /png, /show, /crop, rotate=-90
Modification History
Written by: Ken Mankoff, 2009-ish?
2010-02-02: KDM Added documentation. Changed from ImageMagick
(convert) to GraphicsMagick (gm convert).