public class Print
extends java.lang.Object
Constructor and Description |
---|
Print() |
Modifier and Type | Method and Description |
---|---|
static void |
startPrintJob(PDFDoc in_doc,
java.lang.String in_printerName,
java.lang.String in_jobName,
java.lang.String in_outputFileName,
PageSet in_pagesToPrint,
PrinterMode in_printerMode,
Context in_ctx)
(Windows Only)
Print the PDFDoc to a printer.
|
public static void startPrintJob(PDFDoc in_doc, java.lang.String in_printerName, java.lang.String in_jobName, java.lang.String in_outputFileName, PageSet in_pagesToPrint, PrinterMode in_printerMode, Context in_ctx)
Note: If the printer is grayscale, only grayscale data will be sent.
Throws a trn::Common::Exception on failure.
acquires a write lock on the document
in_doc
- the document to printin_printerName
- the name of the printer to print toin_jobName
- the name of the job for print queue monitoring, can be empty.in_outputFileName
- if not empty, the name of the output file to save the printout
into. This could be a PostScript, PCL, XPS or other file.in_pagesToPrint
- a PageSet defining which pages should be printed in the
document.in_printerMode
- options for the printer, example usage
PrinterMode printerMode = new PrinterMode();
printerMode.PutNumber("CopyCount", 1); // must be greater than zero
printerMode.PutBool("Collation", true); // true or false
// duplexing: {e_DuplexAuto, e_Duplex_None, e_Duplex_LongSide,
e_Duplex_ShortSide} printerMode.PutNumber("Duplexing",
PrinterMode::e_Duplex_Auto);
// output quality: {e_OutputQuality_Draft, e_OutputQuality_Low,
e_OutputQuality_Medium, e_OutputQuality_High}
printerMode.PutNumber("OutputQuality",
PrinterMode::e_OutputQuality_Medium);
// output color: {e_OutputColor_Color, e_OutputColor_Grayscale,
e_OutputColor_Monochrome} printerMode.PutNumber("OutputColor",
PrinterMode::e_OutputColor_Grayscale); printerMode.PutNumber("DPI",
300); // this will override e_PrintQuality_Medium setting
in_ctx
- (Optional) Optional Content Group setting, for example from PDFViewCtrl.getOCGContext.