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:
com.inet.plugin.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 interfaceExportFilePresenter.HasPrintRangeInterface 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 voidapplyPrintRange(ExportFilePresenter.HasPrintRange printToX)Set the print range to the Print-implementation.BasePresenterconfigure(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.OutputStreamgetExportStream()Opens an returns an output stream for the result of the currentBasePresenter.getModel().protected abstract java.lang.StringgetExtension()Get the extension of the target filevoidsetExportOnlyOnDifferences(boolean exportOnlyOnDifferences)Deprecated.As of i-net PDFC 4.3, usePDFComparer.setSettings(Settings)voidsetModel(ResultModel newModel)Registers this presenter to a model.voidsetPrintRange(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
-
-
-
-
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.falsean 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_FILEfrom the configuration.- Overrides:
configurein 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.IOExceptionOpens 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 totruean export will only be generated when there are differences found in the compared PDFs, if set tofalsean 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:
setModelin classBasePresenter- Parameters:
newModel- the new
-
-