public class GhostscriptHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GhostscriptHelper.GhostscriptExecutionException
Exceptions thrown when errors occur during generation and comparison of images obtained on the basis of pdf files.
|
Modifier and Type | Field and Description |
---|---|
static String |
GHOSTSCRIPT_ENVIRONMENT_VARIABLE
The name of the environment variable with the command to execute Ghostscript operations.
|
Constructor and Description |
---|
GhostscriptHelper() |
GhostscriptHelper(String newGsExec) |
Modifier and Type | Method and Description |
---|---|
String |
getCliExecutionCommand()
Returns a command that is used to run the utility.
|
void |
runGhostScriptImageGeneration(String pdf, String outDir, String image)
Runs ghostscript to create images of pdfs.
|
void |
runGhostScriptImageGeneration(String pdf, String outDir, String image, String pageList)
Runs ghostscript to create images of specified pages of pdfs.
|
public static final String GHOSTSCRIPT_ENVIRONMENT_VARIABLE
public GhostscriptHelper()
public GhostscriptHelper(String newGsExec)
public String getCliExecutionCommand()
public void runGhostScriptImageGeneration(String pdf, String outDir, String image) throws IOException, InterruptedException
pdf
- Path to the pdf file.
outDir
- Path to the output directory
image
- Path to the generated image
IOException
- if there are file's reading/writing issues
InterruptedException
- if there is thread interruption while executing GhostScript.
public void runGhostScriptImageGeneration(String pdf, String outDir, String image, String pageList) throws IOException, InterruptedException
pdf
- Path to the pdf file.
outDir
- Path to the output directory
image
- Path to the generated image
pageList
- String with numbers of the required pages to extract as image. Should be formatted as string with numbers, separated by commas, without whitespaces. Can be null, if it is required to extract all pages as images.
IOException
- if there are file's reading/writing issues
InterruptedException
- if there is thread interruption while executing GhostScript.
Copyright © 1998–2021 iText Group NV. All rights reserved.