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
,Cloneable
- Direct Known Subclasses:
DifferencesPDFPresenter
,DifferencesPNGPresenter
Sub-Presenter for Differences-Exports creating a file result, such as PDF or PNG.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Set the print range to the Print-implementation.Sets a boolean flag indicating whether an export will be generated when there are no differences found in the compared PDFs.protected OutputStream
Opens an returns an output stream for the result of the currentBasePresenter.getModel()
.protected abstract String
Get the extension of the target filevoid
setExportOnlyOnDifferences
(boolean exportOnlyOnDifferences) Deprecated.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
-
Constructor Details
-
ExportFilePresenter
public ExportFilePresenter()
-
-
Method Details
-
applyPrintRange
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
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
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:
IOException
- thrown in case the stream could not be created- Since:
- i-net PDFC 3.0
-
getExtension
Get the extension of the target file- Returns:
- the file extension like .pdf or .png
- Since:
- i-net PDFC 4.3
-
setExportOnlyOnDifferences
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
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
-
PDFComparer.setSettings(Settings)