|
Gnostice PDFOne Java
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.gnostice.pdfone.PdfPrinter
public class PdfPrinter
This class represents the printer component of PDFOne Java. To print a PDF document
create a
document object to read the documentcreate a printer object and
specify the document that
needs to be printedprint() method.// Create a reader object with the document that // needs to be printed PdfReader r = PdfReader.fileReader("sample_doc.pdf"); // Create a document object with the reader PdfDocument d = new PdfDocument(r); // Create a printer object PdfPrinter printer = new PdfPrinter(); // Specify the document that needs to be printed printer.setDocument(d); // Print the document printer.print("1", 2); // page range , number of copies // Close all I/O streams associated with // the reader object r.dispose();
| Constructor Summary | |
|---|---|
PdfPrinter()
Zero-argument default constructor. |
|
PdfPrinter(PdfDocument d)
Constructs a PdfPrinter object with specified
PdfDocument object. |
|
| Method Summary | |
|---|---|
void |
print(String pageRange,
int numOfCopies)
Prints pages in specified page range for specified times. |
void |
print(String printerName,
String pageRange,
int numOfCopies)
Prints pages in specified page range for specified times using specified printer. |
void |
setDocument(PdfDocument d)
Specifies document that needs to be printed. |
void |
showPrintDialog()
Displays a non-modal dialog box for receiving print settings from the user and then printing the document if required. |
void |
showPrintDialog(Dialog owner,
boolean modal)
Displays a modal or non-modal dialog box, with a specified dialog as the owner, for receiving print settings from the user and then printing the document if required. |
void |
showPrintDialog(Frame owner,
boolean modal)
Displays a modal or non-modal dialog box, with a specified frame as the owner, for receiving print settings from the user and then printing the document if required. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PdfPrinter()
public PdfPrinter(PdfDocument d)
PdfPrinter object with specified
PdfDocument object.
d - document that needs to be printed| Method Detail |
|---|
public void setDocument(PdfDocument d)
d - the document that needs to be printed
public void print(String pageRange,
int numOfCopies)
throws IOException,
PdfException,
PrinterException
pageRange - pages that need to be printednumOfCopies - number of times the pages need to be printed
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
PrinterException - if a printing error occurs.
public void print(String printerName,
String pageRange,
int numOfCopies)
throws IOException,
PdfException,
PrinterException
printerName - printer with which the pages need to be printedpageRange - pages that need to be printednumOfCopies - number of times the pages need to be printed
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
PrinterException - if a printing error occurs.
public void showPrintDialog()
throws PdfException
PdfException - if an illegal argument is supplied.
public void showPrintDialog(Frame owner,
boolean modal)
throws PdfException
owner - owner frame of the displayed dialog boxmodal - whether the displayed dialog box needs to be a modal
window
PdfException - if an illegal argument is supplied.
public void showPrintDialog(Dialog owner,
boolean modal)
throws PdfException
owner - owner dialog of the displayed dialog boxmodal - whether the displayed dialog box needs to be a modal
window
PdfException - if an illegal argument is supplied.
|
Std. Ed. v2.10 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||