Since version 0.4.0, Ghost4J provides a high level API, to make document handling easier with Ghostscript.
The high level API is composed of the following items:
Documents: A document is an object representing a document (usually a Postscript or PDF file). It provides methods to load, write and count pages on the document itself.
Components: Components are processing units feed with documents. Families of components are: Analyzer, Converter, Modifier and Renderer. Not all types of documents are necessarily supported by components.
Documents are represented by the org.ghost4j.document.Document interface.
Available implementations are:
Class | Description |
---|---|
org.ghost4j.document.PSDocument | Handle Postscript document |
org.ghost4j.document.PDFDocument | Handle PDF document |
Analyzers are components used to extract data of any kind out of a document. They are represented by the org.ghost4j.analyzer.Analyzer interface.
Available implementations are:
Class | Description | Supports Postscript | Supports PDF |
---|---|---|---|
org.ghost4j.analyzer.FontAnalyzer | Extract font information: font names and embedding status | No | Yes |
org.ghost4j.analyzer.InkAnalyzer | Extract ink coverage information for each page in % as CMYK components | Yes | Yes |
Converters are components used to convert documents to a given file format. They are represented by the org.ghost4j.converter.Converter interface.
Available implementations are:
Class | Description | Supports Postscript | Supports PDF |
---|---|---|---|
org.ghost4j.converter.PSConverter | Convert a document to a Postscript file | Yes | Yes |
org.ghost4j.converter.PDFConverter | Convert a document to a PDF file | Yes | Yes |
Modifiers are components used to modify documents. They are represented by the org.ghost4j.modifier.Modifier interface.
Class | Description | Supports Postscript | Supports PDF |
---|---|---|---|
org.ghost4j.modifier.SafeAppenderModifier | Append a document to another. Document types can be mixed | Yes | Yes |
Renderers are components used to render document pages to image files. They are represented byt he org.ghost4j.renderer.Renderer interface.
Available implementations are:
Class | Description | Supports Postscript | Supports PDF |
---|---|---|---|
org.ghost4j.renderer.SimpleRenderer | Render a range of pages from a document to images | Yes | Yes |