Package com.inet.pdfc.presenter
Class ExportFilePresenter
- java.lang.Object
-
- com.inet.pdfc.presenter.BasePresenter
-
- com.inet.pdfc.presenter.ExportPresenter
-
- com.inet.pdfc.presenter.ExportFilePresenter
-
- All Implemented Interfaces:
NamedExtension
,java.lang.Cloneable
- Direct Known Subclasses:
DifferencesPDFPresenter
,DifferencesPNGPresenter
public abstract class ExportFilePresenter extends ExportPresenter
Sub-Presenter for Differences-Exports creating a file result, such as PDF or PNG.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ExportFilePresenter.HasPrintRange
Interface for PrintToX which have a Print-Range property.-
Nested classes/interfaces inherited from class com.inet.pdfc.presenter.BasePresenter
BasePresenter.ERROR_SOURCE
-
-
Field Summary
-
Fields inherited from class com.inet.pdfc.presenter.ExportPresenter
PAINT_BOTH, PAINT_LEFT, PAINT_RIGHT
-
Fields inherited from class com.inet.pdfc.presenter.BasePresenter
LOGGER, MAX_FILENAME_LENGTH
-
-
Constructor Summary
Constructors Constructor Description ExportFilePresenter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
applyPrintRange(ExportFilePresenter.HasPrintRange printToX)
Set the print range to the Print-implementation.BasePresenter
configure(IProfile configuration)
Sets a boolean flag indicating whether an export will be generated when there are no differences found in the compared PDFs.protected java.io.OutputStream
getExportStream()
Opens an returns an output stream for the result of the currentBasePresenter.getModel()
.protected abstract java.lang.String
getExtension()
Get the extension of the target filevoid
setExportOnlyOnDifferences(boolean exportOnlyOnDifferences)
Deprecated.As of i-net PDFC 4.3, usePDFComparer.setSettings(Settings)
void
setModel(ResultModel newModel)
Registers this presenter to a model.void
setPrintRange(int from, int to)
Set the range of pages to render into the export-document.
If both parameters are -1, all pages will be printed.-
Methods inherited from class com.inet.pdfc.presenter.ExportPresenter
createAndSetupPrintPainter, setAddHeaderFooter, setBackgroundColor, setColorprovider, setOverlapAlpha, setPaintOverlap, setPaintSides, setScaleToFitPageHeight
-
Methods inherited from class com.inet.pdfc.presenter.BasePresenter
canInformUserOnErrors, createExportFilename, detachFromModel, executeImmediately, getDefaultExportName, getLastPresenterException, getModel, getParent, getPresenterExceptions, onClear, onComparisonDone, onDataUpdate, onError, onFilterChange, onFinish, onInit, onProgressUpdate, setParent, spawn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.inet.plugin.NamedExtension
getExtensionName
-
-
-
-
Method Detail
-
applyPrintRange
protected void applyPrintRange(ExportFilePresenter.HasPrintRange printToX)
Set the print range to the Print-implementation.- Parameters:
printToX
- the print implementation- Since:
- i-net PDFC 3.0
-
setPrintRange
public void setPrintRange(int from, int to)
Set the range of pages to render into the export-document.
If both parameters are -1, all pages will be printed. This is the default setting.- Parameters:
from
- the first page to include, 0-based.to
- the last page to include, must be greater or equal to from and smaller than the total number of pages available- Since:
- i-net PDFC 3.0
-
configure
public BasePresenter configure(IProfile configuration)
Sets a boolean flag indicating whether an export will be generated when there are no differences found in the compared PDFs.Default value is
differences found in the compared PDFs, if set tofalse
.false
an export will always be generated even when there are no differences. Configures the presenter according to a configuration. The presenter will read the propertyPDFCProperty.MAX_ERRORS_PER_FILE
from the configuration.- Overrides:
configure
in classBasePresenter
- Parameters:
configuration
- the configuration to read from, must not benull
- Returns:
- this instance for concatenation
-
getExportStream
protected java.io.OutputStream getExportStream() throws java.io.IOException
Opens an returns an output stream for the result of the currentBasePresenter.getModel()
. The caller of this method will close the stream itself!- Returns:
- the stream to write the current result to
- Throws:
java.io.IOException
- thrown in case the stream could not be created- Since:
- i-net PDFC 3.0
-
getExtension
protected abstract java.lang.String getExtension()
Get the extension of the target file- Returns:
- the file extension like .pdf or .png
- Since:
- i-net PDFC 4.3
-
setExportOnlyOnDifferences
@Deprecated public void setExportOnlyOnDifferences(boolean exportOnlyOnDifferences)
Deprecated.As of i-net PDFC 4.3, usePDFComparer.setSettings(Settings)
Sets a boolean flag indicating whether an export will be generated when there are no differences found in the compared PDFs.Default value is
false
.- Parameters:
exportOnlyOnDifferences
- if set totrue
an export will only be generated when there are differences found in the compared PDFs, if set tofalse
an export will always be generated even when there are no differences.- Since:
- i-net PDFC 4.0
-
setModel
public void setModel(ResultModel newModel)
Registers this presenter to a model. If it already was registered to a model, the old model will be detached first.- Overrides:
setModel
in classBasePresenter
- Parameters:
newModel
- the new
-
-