PostScript libraries for Java
- xmlgraphics-commons from Apache (used by Apache FOP and Batik) turns Java2D drawing into PostScript with
PSDocumentGraphics2D, and has a DSC parser that reads page count, bounding box and page structure without interpreting the PostScript. Apache-2.0.
Java has no maintained PostScript interpreter. To render or convert existing PostScript from Java, run Ghostscript as a process (ProcessBuilder with gs -sDEVICE=png16m ...) or through JNA; Ghost4J wraps the Ghostscript API but hasn’t been released since 2016.
- xmlgraphics-commons Apache XML Graphics Commons writes PostScript from Java2D and parses DSC comments. How to add it with Maven, create multi-page PS files, read page count.