Package de.tsl2.nano.util
Class PrintUtil
java.lang.Object
de.tsl2.nano.util.PrintUtil
provides generic print convenience methods for non-interactive prints.
NOTE-1: use 'PCL6 Driver for Universal Print' or 'PDFCreator' to test the printing.
NOTE-2: PCL-Problem: http://xmlgraphics.apache.org/fop/1.0/output.html:
If you run into the problem that the printed output is incomplete on Windows: this often happens to users printing to a PCL printer. There seems to be an incompatibility between Java and certain PCL printer drivers on Windows. Since most network-enabled laser printers support PostScript, try switching to the PostScript printer driver for that printer model.
If you run into the problem that the printed output is incomplete on Windows: this often happens to users printing to a PCL printer. There seems to be an incompatibility between Java and certain PCL printer drivers on Windows. Since most network-enabled laser printers support PostScript, try switching to the PostScript printer driver for that printer model.
- Version:
- $Revision$
- Author:
- Tom
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PrintServicegetPrintService(String printerName, String mimeType) static PrintServicegetPrintService(String printerName, DocFlavor.INPUT_STREAM docFlavor, DocAttributeSet das) static voidstatic DocPrintJobdelegates to#print(String, String, InputStream, PrintQuality, int, int[]...).static DocPrintJobdelegates to#print(String, String, InputStream, PrintQuality, int, int[]...).static DocPrintJobprint(String jobName, String printerName, InputStream stream, String mimeType, String username, MediaSizeName paperSize, PrintQuality quality, int priority, int[]... pageranges) prints through standard javax.print servicesstatic DocPrintJobprint(String jobName, String printerName, InputStream stream, String mimeType, PrintRequestAttributeSet pras) prints through standard javax.print servicesstatic voidconvenience to send an apache-fop transformed file to the given printer. delegates toXmlGenUtil.fop(File, String, File)andprint(String, String, InputStream).
-
Constructor Details
-
PrintUtil
public PrintUtil()
-
-
Method Details
-
print
delegates to#print(String, String, InputStream, PrintQuality, int, int[]...). -
print
delegates to#print(String, String, InputStream, PrintQuality, int, int[]...). -
print
public static DocPrintJob print(String jobName, String printerName, InputStream stream, String mimeType, String username, MediaSizeName paperSize, PrintQuality quality, int priority, int[]... pageranges) prints through standard javax.print services- Parameters:
jobName- print job nameprinterName- to select a special available printerstream- stream to be sent to the printermimeType- (optional) mime-type of stream contentusername- (optional) user-name to be used by the printerpaperSize- (optional) something likeMediaSizeName.ISO_A4.quality- (optional) quality one of enumPrintQualitypriority- (optional) priority number between 1 and 100. if lower than 1, it will be ignored!pageranges- (optional) pageranges pages to be printed- Returns:
- the started print job
-
print
public static DocPrintJob print(String jobName, String printerName, InputStream stream, String mimeType, PrintRequestAttributeSet pras) prints through standard javax.print services- Parameters:
jobName- print job nameprinterName- to select a special available printerstream- stream to be sent to the printer. if null, a printer-info will be shown!mimeType- (optional) mime-type of stream contentpras- additional print attributes- Returns:
- the print job
-
getPrintService
-
getPrintService
public static PrintService getPrintService(String printerName, DocFlavor.INPUT_STREAM docFlavor, DocAttributeSet das) -
printFOP
convenience to send an apache-fop transformed file to the given printer. delegates toXmlGenUtil.fop(File, String, File)andprint(String, String, InputStream). -
main
-