diagrams-postscript

Postscript backend for Diagrams.


Keywords
graphics, library, Propose Tags, Diagrams.Backend.Postscript.CmdLine, Diagrams.Backend.Postscript, Diagrams.Backend.CMYK, , Index, Quick Jump, Diagrams.Backend.Postscript.CMYK, Graphics.Rendering.Postscript, diagrams-postscript-1.5.1.1.tar.gz, browse, Package description, revised, metadata revisions, Package maintainers, BrentYorgey, RyanYates, jeffreyrosenbluth, bergey, cchalmers, edit package information
License
BSD-3-Clause
Install
cabal install diagrams-postscript-1.5.1.1

Documentation

Build Status

diagrams-postscript is a rendering backend for diagrams, a powerful, flexible, declarative domain-specific language for creating vector graphics, using the Haskell programming language.

diagrams-postscript has a simple rendering engine that outputs PostScriptâ„¢ language files and is an officially supported backend for diagrams.

Installation

cabal update && cabal install diagrams-postscript

Basic usage

A simple example that uses diagrams-postscript to draw a blue circle:

import Diagrams.Prelude
import Diagrams.Backend.Postscript.CmdLine

d = circle 1 # fc blue

main = mainWith (pad 1.1 d)

Save this to file named Circle.hs and compile it:

ghc --make Circle.hs

This will generate an executable which, when run, outputs a blue circle to some file. Run the executable with the --help option to find out more about how to call it.

$ ./Circle --help
./Circle

Usage: ./Circle [-w|--width WIDTH] [-h|--height HEIGHT] [-o|--output OUTPUT]
  Command-line diagram generation.

Available options:
  -?,--help                Show this help text
  -w,--width WIDTH         Desired WIDTH of the output image
  -h,--height HEIGHT       Desired HEIGHT of the output image
  -o,--output OUTPUT       OUTPUT file

The output type will be automatically determined from the file extension. Currently EPS and PS are supported.

$ ./Circle -o circle.eps -w 400

The command above generates an EPS file with a width of 400pt.

Advanced usage

Instead of just creating a standalone executable, the postscript backend can also be called from within a larger program. For more information, see the Diagram.Backend.Postscript module.

--

PostScriptâ„¢ is a trademark of Adobe.