public class DifferencesImagePresenter extends BasePresenter
Modifier and Type | Class and Description |
---|---|
static class |
DifferencesImagePresenter.IMAGE_CONFIG
Deprecated.
As of i-net PDFC 5.0
|
BasePresenter.ERROR_SOURCE
LOGGER, MAX_FILENAME_LENGTH
Constructor and Description |
---|
DifferencesImagePresenter()
Creates a difference image presenter.
|
DifferencesImagePresenter(java.io.File rootFolder)
Creates a difference image presenter.
|
Modifier and Type | Method and Description |
---|---|
DifferencesImagePresenter |
configure(IProfile profile)
Configures the presenter according to a profile.
|
static DifferencesImagePresenter.IMAGE_CONFIG |
getConfigSetting(IProfile config)
Deprecated.
As of i-net PDFC 5.0 , the property will be stored in settings
Settings.EXPORT.CREATE_DIFFIMAGES_FIRST and Settings.EXPORT.CREATE_DIFFIMAGES_SECOND |
java.lang.String |
getExtensionName()
Returns the UNIQUE name of the extension.
|
void |
onComparisonDone()
Called to indicate that a comparison has finished.
|
void |
onInit()
Creates the root and the subfolder for the current comparison run.
|
void |
setCreateDifferenceImages(boolean forFirstDocument,
boolean forSecondDocument,
boolean xorOfDocuments)
Deprecated.
As of i-net PDFC 5.0, use instead
PDFComparer.setSettings(Settings) -> Settings.EXPORT.CREATE_DIFFIMAGES_FIRST , Settings.EXPORT.CREATE_DIFFIMAGES_SECOND , Settings.EXPORT.CREATE_XORIMAGES |
void |
setCreatePageImages(boolean createPageImages)
Deprecated.
As of i-net PDFC 5.0, use instead
PDFComparer.setSettings(Settings) -> Settings.EXPORT.CREATE_ORIGIMAGES |
void |
setImageScaleFactor(double scale)
Sets the scale factor for all produced images.
|
BasePresenter |
spawn(boolean spawnWithParent)
Creates another presenter of the the same type as the current one.
|
protected void |
writeDifferencesImage(int pageIndex,
java.awt.image.BufferedImage targetImg)
Writes a differences image.
|
protected void |
writePageImage(int pageIndex,
boolean isFirstPDF,
java.awt.image.BufferedImage pageImage)
Writes the image of a rendered page.
|
canInformUserOnErrors, createExportFilename, detachFromModel, executeImmediately, getDefaultExportName, getLastPresenterException, getModel, getParent, getPresenterExceptions, onClear, onDataUpdate, onError, onFilterChange, onFinish, onProgressUpdate, setModel, setParent
public DifferencesImagePresenter()
setCreateDifferenceImages(boolean, boolean, boolean)
.public DifferencesImagePresenter(java.io.File rootFolder)
rootFolder
- the root folder for all difference folders. must not be null
public java.lang.String getExtensionName()
public BasePresenter spawn(boolean spawnWithParent)
spawn
in class BasePresenter
spawnWithParent
- if true, the presenter is allowed to keep a reference to it's parent to create a summary on onFinish()public DifferencesImagePresenter configure(IProfile profile)
PDFCProperty.IMAGE_SCALE_FACTOR
from the profile.configure
in class BasePresenter
profile
- the profile to read from, must not be null
@Deprecated public void setCreateDifferenceImages(boolean forFirstDocument, boolean forSecondDocument, boolean xorOfDocuments)
PDFComparer.setSettings(Settings)
-> Settings.EXPORT.CREATE_DIFFIMAGES_FIRST
, Settings.EXPORT.CREATE_DIFFIMAGES_SECOND
, Settings.EXPORT.CREATE_XORIMAGES
forFirstDocument
- set to include the page of the first documentforSecondDocument
- set to include the page of the second documentxorOfDocuments
- set to include an XOR-image of the pages pair@Deprecated public void setCreatePageImages(boolean createPageImages)
PDFComparer.setSettings(Settings)
-> Settings.EXPORT.CREATE_ORIGIMAGES
createPageImages
- true
to enablepublic void setImageScaleFactor(double scale)
scale
- the (positive) scale factorjava.lang.IllegalArgumentException
- if scale is <= 0public void onInit() throws java.lang.Exception
onInit
in class BasePresenter
java.lang.Exception
- not thrown in this implementationjava.io.IOException
- in case the destination folder cannot be accessed or createdpublic void onComparisonDone() throws java.lang.Exception
onComparisonDone
in class BasePresenter
java.lang.Exception
- thrown in case the processing of the finish step failsprotected void writeDifferencesImage(int pageIndex, java.awt.image.BufferedImage targetImg)
pageIndex
- the zero based index of the page pair presented in the imagetargetImg
- the rendered difference image, never null
protected void writePageImage(int pageIndex, boolean isFirstPDF, java.awt.image.BufferedImage pageImage)
PDFCProperty.CREATE_ORIGIMAGES
is set to 'true'.pageIndex
- the zero-based index of the pageisFirstPDF
- true, if the page belongs to the first document hence falsepageImage
- the image of the page, unscaled@Deprecated public static DifferencesImagePresenter.IMAGE_CONFIG getConfigSetting(IProfile config)
Settings.EXPORT.CREATE_DIFFIMAGES_FIRST
and Settings.EXPORT.CREATE_DIFFIMAGES_SECOND
config
- the configuration to readCopyright © 2010-2022 by i-net software GmbH