public class DocumentPrintNode extends Node
This Node
is used to print out documents via the Java™ Print Service API.
As the functionality of this node is based on the jadice document platform only
those type of documents are supported that the jadice document platform can load. In any
other case the action specified via #setUnhandledFormatAction(UnhandledFormatAction)
and
an event with MessageID JS.DOCP-UNKNOWN_DOCUMENT_FORMAT
will be fired.
As this node is a data sink it must not have a successor.
Its worker respects PageCountLimit
s.
Modifier and Type | Class and Description |
---|---|
static class |
DocumentPrintNode.OutputReferenceBase
The reference base specifies what is used as the basic area of the printed output on the paper
as well as how scaling/fitting/rotation- optimization is performed.
|
Node.Cardinality
Constructor and Description |
---|
DocumentPrintNode() |
Modifier and Type | Method and Description |
---|---|
Node.Cardinality |
getOutputCardinality()
Return the output cardinality of this node, i.e.
|
PageFormat |
getPageFormat() |
PrintRequestAttributeSet |
getPrintRequestAttributeSet() |
String |
getPrintServiceName() |
DocumentPrintNode.OutputReferenceBase |
getReferenceBase() |
JadiceDocumentInfoNode.UnhandledFormatAction |
getUnhandledFormatAction() |
String |
getWorkerClassName()
Return the node's associated
NodeWorker full qualified class's
name. |
boolean |
isEnlargePageToPaper() |
boolean |
isOptimizeRotation() |
boolean |
isShrinkPageToPaper() |
void |
setEnlargePageToPaper(boolean enlargePageToPaper)
Set if the the page shall be enlarged to fit onto the paper.
|
void |
setOptimizeRotation(boolean optimizeRotation)
If this flag is set the rotation of the pages will be optimized.
|
void |
setPageFormat(PageFormat pageFormat)
Sets a
PageFormat object that will be used as the media on which the printer will
print. |
void |
setPrintRequestAttributeSet(PrintRequestAttributeSet printAttributes)
Set print request attributes, e.g.
|
void |
setPrintServiceName(String printServiceName)
Set the name of the printer service that the server will use, i.e.
|
void |
setReferenceBase(DocumentPrintNode.OutputReferenceBase referenceBase)
Sets the reference base.
|
void |
setShrinkPageToPaper(boolean shrinkPageToPaper)
Set if the the page shall be shrinked to fit onto the paper completely.
|
void |
setUnhandledFormatAction(JadiceDocumentInfoNode.UnhandledFormatAction action)
Set the action to take when a given document has an unknown or unsupported format.
|
protected void |
validateConfiguration() |
addTransportReceiver, appendSuccessor, apply, equals, getInputCardinality, getJob, getPredecessors, getSubsidiaryNodes, getSuccessors, getTransportSender, getUUID, hashCode, initialize, prependPredecessor, remove
public void setPrintServiceName(String printServiceName)
Set the name of the printer service that the server will use, i.e. printer name. This service must be available on the server side. Otherwise the job will fail.
Default value:null
, uses the default print serviceprintServiceName
- name of the print service to usePrintServiceLookup
public String getPrintServiceName()
public void setPrintRequestAttributeSet(PrintRequestAttributeSet printAttributes)
Set print request attributes, e.g. number of copies, duplex mode.
Default value: empty set. This property must not be null.
printAttributes
- attributes the print service shall use.PrintRequestAttributeSet
,
PrintRequestAttribute
public PrintRequestAttributeSet getPrintRequestAttributeSet()
public void setPageFormat(PageFormat pageFormat)
PageFormat
object that will be used as the media on which the printer will
print. The PageFormat
will be validated and if necessary corrected by printer drivers
before start physical printing if the preferences indicates a validation and correction.
As PageFormat
is not Serializable
, a wrapper class must be used
here.
pageFormat
- the PageFormat
object to be set.public PageFormat getPageFormat()
PageFormat
that the printer will use.public void setEnlargePageToPaper(boolean enlargePageToPaper)
false
enlargePageToPaper
- pages will be enlarged to page size iff true
public boolean isEnlargePageToPaper()
public void setShrinkPageToPaper(boolean shrinkPageToPaper)
true
shrinkPageToPaper
- pages will be shrinked to page size iff true
public boolean isShrinkPageToPaper()
public void setOptimizeRotation(boolean optimizeRotation)
If this flag is set the rotation of the pages will be optimized. Optimization means that landscape pages will be rotated to that the fit better onto portrait pages and vice versa.
optimizeRotation
- pages can be rotated iff set to true
public boolean isOptimizeRotation()
public void setReferenceBase(DocumentPrintNode.OutputReferenceBase referenceBase)
Sets the reference base. Reference base defines whether the imageable area or the paper is used for the fitting of the content.
Default value:DocumentPrintNode.OutputReferenceBase.PAGEFORMAT
. This property must not be null.
referenceBase
- the reference base to useDocumentPrintNode.OutputReferenceBase
public DocumentPrintNode.OutputReferenceBase getReferenceBase()
DocumentPrintNode.OutputReferenceBase
public void setUnhandledFormatAction(JadiceDocumentInfoNode.UnhandledFormatAction action)
Set the action to take when a given document has an unknown or unsupported format.
Caveat: If set to JadiceDocumentInfoNode.UnhandledFormatAction.WARN
the document will be printed by
hook or by crook, even if it might be interpreted as plain text ASCII document which will
produce lots of wasted pages.
This value must not be null
.
action
- action to take. Default: JadiceDocumentInfoNode.UnhandledFormatAction.ABORT
public JadiceDocumentInfoNode.UnhandledFormatAction getUnhandledFormatAction()
public String getWorkerClassName()
Node
Return the node's associated
NodeWorker
full qualified class's
name. By default, the worker class name is
This behavior can be overridden in concrete subclasses.
getWorkerClassName
in class Node
protected void validateConfiguration() throws ConfigurationException
validateConfiguration
in class Node
ConfigurationException
public Node.Cardinality getOutputCardinality()
Node
getOutputCardinality
in class Node
Copyright © 2017 levigo holding gmbh. All rights reserved.