EPS libraries
Rendering EPS means running PostScript, so every library that reads EPS uses Ghostscript underneath. Ghostscript is AGPL-3.0 (or commercial from Artifex); check the license before shipping it or running it in a service. Libraries that only write EPS (cairo, xmlgraphics-commons, canvas, gonum/plot, matplotlib) don’t need it.
| Language | Library | Read | Write | Notes |
|---|---|---|---|---|
| C/C++ | Ghostscript | yes | yes | render with -dEPSCrop, compute the bounding box, write with eps2write. AGPL |
| C/C++ | libspectre | yes | no | DSC metadata and rendering for viewers, on top of Ghostscript. GPL-2.0 |
| C/C++ | cairo | no | yes | vector drawing to EPS with cairo_ps_surface_set_eps |
| C# | Magick.NET | yes | yes | rasterize EPS through Ghostscript, write raster EPS |
| C# | Ghostscript.NET | yes | yes | Ghostscript wrapper with EPS clipping. AGPL |
| Java | xmlgraphics-commons | DSC only | yes | Java2D to EPS, bounding box from DSC comments |
| Go | gonum/plot | no | yes | plots and charts saved as EPS |
| Go | canvas | no | yes | pure Go vector graphics with an EPS renderer |
| Python | Pillow | yes | yes | rasterize EPS through Ghostscript, read binary-header EPS |
| Python | Matplotlib | no | yes | charts saved as EPS |
| Python | pycairo | no | yes | cairo bindings, PSSurface.set_eps(True) |
| Ruby | MiniMagick | yes | yes | ImageMagick command line from Ruby |
| Rust | cairo-rs | no | yes | gtk-rs cairo bindings, PsSurface::set_eps |
| PHP | Imagick | yes | yes | ImageMagick extension; reads EPS through Ghostscript |
To read only the bounding box or the preview of an EPS file you don’t need Ghostscript: the %%BoundingBox line and the 30-byte binary header are simple to parse yourself (see EPS file structure).
By language#
- EPS libraries for C/C++ Open-source C/C++ libraries for EPS: Ghostscript to render and convert, libspectre for viewers, cairo to write Encapsulated PostScript. Comparison.
- EPS libraries for C# Open-source .NET libraries for EPS: Magick.NET to rasterize and write EPS, Ghostscript.NET to render and convert EPS with Ghostscript. Comparison.
- EPS libraries for Java Open-source Java libraries for EPS: Apache xmlgraphics-commons writes EPS from Java2D and reads the bounding box from DSC comments. Code examples.
- EPS libraries for Go Open-source Go libraries that write EPS: gonum/plot saves charts as EPS, tdewolff/canvas draws vector graphics and writes EPS. Comparison and code examples.
- EPS libraries for Python Open-source Python libraries for EPS: Pillow to convert EPS to PNG, Matplotlib to save charts as EPS, pycairo to draw EPS. Comparison and code examples.
- EPS libraries for Ruby Open-source Ruby libraries for EPS: MiniMagick converts EPS to PNG or JPEG and writes EPS through ImageMagick and Ghostscript. Code examples.
- EPS libraries for Rust Open-source Rust libraries for EPS: cairo-rs writes Encapsulated PostScript through cairo's PsSurface. Code examples and notes on reading EPS from Rust.
- EPS libraries for PHP Open-source PHP libraries for EPS: the Imagick extension converts EPS to PNG or JPEG and writes EPS through ImageMagick and Ghostscript. Code examples.