org.cups4j
Class PrintJob.Builder

java.lang.Object
  extended by org.cups4j.PrintJob.Builder
Enclosing class:
PrintJob

public static class PrintJob.Builder
extends java.lang.Object

Builds PrintJob objects like so:

PrintJob printJob = new PrintJob.Builder(document).jobName("jobXY").userName ("harald").copies(2).build();

documents are supplied as byte[] or as InputStream


Constructor Summary
PrintJob.Builder(byte[] document)
          Constructor
PrintJob.Builder(java.io.InputStream document)
          Constructor
 
Method Summary
 PrintJob.Builder attributes(java.util.Map<java.lang.String,java.lang.String> attributes)
          Additional attributes for the print operation and the print job
 PrintJob build()
          Builds the PrintJob object.
 PrintJob.Builder copies(int copies)
          Number of copies - 0 and 1 are both treated as one copy
 PrintJob.Builder duplex(boolean duplex)
          Duplex mode
 PrintJob.Builder jobName(java.lang.String jobName)
          Job name
 PrintJob.Builder pageRanges(java.lang.String pageRanges)
          Page ranges
 PrintJob.Builder userName(java.lang.String userName)
          User name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintJob.Builder

public PrintJob.Builder(byte[] document)
Constructor

Parameters:
byte[] - document

PrintJob.Builder

public PrintJob.Builder(java.io.InputStream document)
Constructor

Parameters:
InputStream - document
Method Detail

copies

public PrintJob.Builder copies(int copies)
Number of copies - 0 and 1 are both treated as one copy

Parameters:
copies -
Returns:
Builder

pageRanges

public PrintJob.Builder pageRanges(java.lang.String pageRanges)
Page ranges

Returns:
Builder

userName

public PrintJob.Builder userName(java.lang.String userName)
User name

Parameters:
userName -
Returns:
Builder

jobName

public PrintJob.Builder jobName(java.lang.String jobName)
Job name

Parameters:
jobName -
Returns:
Builder

duplex

public PrintJob.Builder duplex(boolean duplex)
Duplex mode

Parameters:
duplex -
Returns:
Builder

attributes

public PrintJob.Builder attributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Additional attributes for the print operation and the print job

Parameters:
attributes - provide operation attributes and/or a String of job-attributes

job attributes are sperated by "#"

example:

attributes.put("compression","none");

attributes.put("job-attributes", "print-quality:enum:3#sheet-collate:keyword:collated#sides:keyword:two-sided-long-edge" );

-> take a look config/ippclient/list-of-attributes.xml for more information

Returns:
Builder

build

public PrintJob build()
Builds the PrintJob object.

Returns:
PrintJob


Copyright © 2009 Harald Weyhing. All Rights Reserved.