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,Cloneable
- Direct Known Subclasses:
DifferencesPDFPresenter,DifferencesPNGPresenter
Sub-Presenter for Differences-Exports creating a file result, such as PDF or PNG.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface 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_RIGHTFields inherited from class com.inet.pdfc.presenter.BasePresenter
LOGGER, MAX_FILENAME_LENGTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidSet 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 OutputStreamOpens an returns an output stream for the result of the currentBasePresenter.getModel().protected abstract StringGet the extension of the target filevoidsetExportOnlyOnDifferences(boolean exportOnlyOnDifferences) Deprecated.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, setScaleToFitPageHeightMethods 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, spawnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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.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
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 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
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
-
PDFComparer.setSettings(Settings)