Class ImageHandlerUtil
public sealed class ImageHandlerUtil
- Inheritance
-
ImageHandlerUtil
- Inherited Members
Constructors
ImageHandlerUtil()
public ImageHandlerUtil()
Fields
GHOSTSCRIPT_ENVIRONMENT_VARIABLE
The name of the environment variable with the command to execute Ghostscript operations.
public const string GHOSTSCRIPT_ENVIRONMENT_VARIABLE = "ITEXT_GS_EXEC"
Field Value
GHOSTSCRIPT_ENVIRONMENT_VARIABLE_LEGACY
[Obsolete]
public const string GHOSTSCRIPT_ENVIRONMENT_VARIABLE_LEGACY = "gsExec"
Field Value
GHOSTSCRIPT_KEYWORD
public const string GHOSTSCRIPT_KEYWORD = "GPL Ghostscript"
Field Value
GS_ENVIRONMENT_VARIABLE_IS_NOT_SPECIFIED
public const string GS_ENVIRONMENT_VARIABLE_IS_NOT_SPECIFIED = "Ghostscript command is not specified. Set the ITEXT_GS_EXEC environment variable to a CLI command that can run the Ghostscript application. See BUILDING.MD in the root of the repository for more details."
Field Value
MAGICK_COMPARE_ENVIRONMENT_VARIABLE
The name of the environment variable with the command to execute ImageMagic comparison operations.
public const string MAGICK_COMPARE_ENVIRONMENT_VARIABLE = "ITEXT_MAGICK_COMPARE_EXEC"
Field Value
MAGICK_COMPARE_ENVIRONMENT_VARIABLE_LEGACY
[Obsolete]
public const string MAGICK_COMPARE_ENVIRONMENT_VARIABLE_LEGACY = "compareExec"
Field Value
MAGICK_COMPARE_KEYWORD
public const string MAGICK_COMPARE_KEYWORD = "ImageMagick Studio LLC"
Field Value
UNABLE_TO_CREATE_DIFF_FILES_ERROR_MESSAGE
public const string UNABLE_TO_CREATE_DIFF_FILES_ERROR_MESSAGE = "Unable to create files with differences between pages because ImageMagick comparison command is not specified. Set the ITEXT_MAGICK_COMPARE_EXEC environment variable with the CLI command which can run the ImageMagic comparison. See BUILDING.MD in the root of the repository for more details."
Field Value
Methods
GetCompareExec()
public string GetCompareExec()
Returns
GetGsExec()
public string GetGsExec()
Returns
IsVersionCommandExecutable(string)
Checks if the specified by input parameter tool's system variable is correctly specified and the specified tool can be executed.
public bool IsVersionCommandExecutable(string keyWord)
Parameters
keyWord
stringthe keyword specifying the tool (GhostScript or ImageMagick)
Returns
- bool
boolean result of checking: true - System variable is correctly specified and the specified tool can be executed
RunGhostScriptImageGeneration(string, string, string)
Runs ghostscript to create images of pdfs.
public void RunGhostScriptImageGeneration(string pdf, string outDir, string image)
Parameters
pdf
stringPath to the pdf file.
outDir
stringPath to the output directory
image
stringPath to the generated image
RunGhostScriptImageGeneration(string, string, string, string)
Runs ghostscript to create images of specified pages of pdfs.
public void RunGhostScriptImageGeneration(string pdf, string outDir, string image, string pageNumber)
Parameters
pdf
stringPath to the pdf file.
outDir
stringPath to the output directory
image
stringPath to the generated image
pageNumber
stringNumber of the required page of pdf to extract as image. Can be null, if it is required to extract all pages as images
RunImageMagickImageCompare(string, string, string)
Runs imageMagick to visually compare images and generate difference output.
public bool RunImageMagickImageCompare(string outImageFilePath, string cmpImageFilePath, string diffImageName)
Parameters
outImageFilePath
stringPath to the output image file
cmpImageFilePath
stringPath to the cmp image file
diffImageName
stringPath to the difference output image file
Returns
- bool
boolean result of comparing: true - images are visually equal
RunImageMagickImageCompare(string, string, string, string)
Runs imageMagick to visually compare images with the specified fuzziness value and generate difference output.
public bool RunImageMagickImageCompare(string outImageFilePath, string cmpImageFilePath, string diffImageName, string fuzzValue)
Parameters
outImageFilePath
stringPath to the output image file
cmpImageFilePath
stringPath to the cmp image file
diffImageName
stringPath to the difference output image file
fuzzValue
stringfuzziness value to compare images. Can be null, if it is not required to use fuzziness
Returns
- bool
boolean result of comparing: true - images are visually equal
SetCompareExec(string)
public void SetCompareExec(string newCompareExec)
Parameters
newCompareExec
string
SetGsExec(string)
public void SetGsExec(string newGsExec)
Parameters
newGsExec
string