|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.qoppa.pdfPrint.PDFPrint
The PDFPrint class provides methods to print a pdf document.
| Field Summary |
| Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
| Constructor Summary | |
PDFPrint(InputStream inStream,
IPassword password)
Loads a PDF document from an InputStream. |
|
PDFPrint(String fileName,
IPassword password)
Loads a PDF document from a file. |
|
PDFPrint(URL url,
IPassword password)
Loads a PDF document from a URL. |
|
| Method Summary | |
Pageable |
getPageable(PrinterJob pJob)
Returns an object that implements Pageable for this PDF document. |
int |
getPageCount()
Returns the number of pages in this document. |
PageFormat |
getPageFormat(int pageIndex)
Returns a PageFormat object for the given page. |
PrintSettings |
getPrintSettings()
Returns the PrintSettings that will be used when printing the document. |
static String |
getVersion()
Returns version string for jPDFPrint. |
boolean |
isPrintAllowed()
Returns whether this document has permissions to print. |
int |
print(Graphics graphics,
PageFormat pageFormat,
int pageIndex)
Prints the page. |
void |
print(PrintSettings printSettings)
Prints this PDF document. |
void |
print(String printerName,
PrintSettings printSettings)
Prints this PDF document to the specified printer, by name. |
static void |
print(String fileName,
PrintSettings printSettings,
IPassword password)
Convenience method to print a PDF document from a file. |
void |
print(String printerName,
PrintSettings printSettings,
PrintRequestAttributeSet printAttrSet)
Prints this PDF document to the specified printer, by name and passes the attribute set to the printer job. |
static void |
print(String fileName,
String printerName,
PrintSettings printSettings,
IPassword password)
Convenience method to print a PDF document from a file to a named printer. |
void |
printToDefaultPrinter(PrintSettings printSettings)
Prints the PDF document to the default printer. |
static boolean |
setAppletKey(String key,
Applet applet)
Method to unlock the production version of the library. |
static boolean |
setKey(String key)
Method to unlock the production version of the library. |
void |
setPrintSettings(PrintSettings printSettings)
Set the PrintSettings used when printing this document while using the class as a Printable (rather than calling one of the print methods). |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PDFPrint(String fileName,
IPassword password)
throws PDFException
fileName - Name of the PDF file.password - An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword class that can hold a single
password or a list of passwords.
public PDFPrint(InputStream inStream,
IPassword password)
throws PDFException
inStream - InputStream to read the PDF document.password - An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword class that can hold a single
password or a list of passwords.
public PDFPrint(URL url,
IPassword password)
throws PDFException
url - Location of the PDF document.password - An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword class that can hold a single
password or a list of passwords.| Method Detail |
public static void print(String fileName,
PrintSettings printSettings,
IPassword password)
throws PrinterException,
PDFException
fileName - Name of the PDF file.printSettings - Print job settings. Use this object to tell
the library how to print the document. The library uses default
settings when null is used.password - An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword class that can hold a single
password or a list of passwords.
PrinterException
PDFException
public static void print(String fileName,
String printerName,
PrintSettings printSettings,
IPassword password)
throws PrinterException,
PDFException
fileName - Name of the PDF file.printerName - Name of the printer to print to. If null, prints to
the default printer.printSettings - Print job settings. Use this object to tell
the library how to print the document. The library uses default
settings when null is used.password - An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword class that can hold a single
password or a list of passwords.
PrinterException
PDFException
public void print(PrintSettings printSettings)
throws PDFPermissionException,
PrinterException
printSettings - Print job settings. Use this object to tell
the library how to print the document. If null, the library will
print using default settings.
PDFPermissionException
PrinterException
public void print(String printerName,
PrintSettings printSettings)
throws PDFPermissionException,
PrinterException
printSettings - Print job settings. Use this object to tell
the library how to print the document. If null, the library will
print using default settings.printerName - The name of the printer to print to. If this parameter
is set to null, the method will print to the default printer.
PrinterException - This exception is thrown if the printer is not
found or if there is an error while printing.
PDFPermissionException
public void print(String printerName,
PrintSettings printSettings,
PrintRequestAttributeSet printAttrSet)
throws PDFPermissionException,
PrinterException
printSettings - Print job settings. Use this object to tell
the library how to print the document. If null, the library will
print using default settings.printerName - The name of the printer to print to. If this parameter
is set to null, the method will print to the default printer.printAttrSet - The attribute set to pass to the printer. This parameter simply gets passed through to the printer job to set options
such as the media tray, chromaticity and others. If null is passed, the print job will use default attributes.
PrinterException - This exception is thrown if the printer is not
found or if there is an error while printing.
PDFPermissionException
public void printToDefaultPrinter(PrintSettings printSettings)
throws PDFPermissionException,
PrinterException
printSettings - Print job settings. Use this object to tell
the library how to print the document. If null, the library will
print using default settings.
PrinterException - This exception is thrown if the printer is not
found or if there is an error while printing.
PDFPermissionExceptionpublic static boolean setKey(String key)
key - Production key.
public static boolean setAppletKey(String key,
Applet applet)
key - Production key.public static String getVersion()
public int print(Graphics graphics,
PageFormat pageFormat,
int pageIndex)
throws PrinterException
print in interface PrintablePrinterExceptionpublic PrintSettings getPrintSettings()
public Pageable getPageable(PrinterJob pJob)
pJob - PrinterJob object where the Pageable will be used.
public void setPrintSettings(PrintSettings printSettings)
printSettings - PrintSettings to use when printing.
public PageFormat getPageFormat(int pageIndex)
throws IndexOutOfBoundsException
IndexOutOfBoundsExceptionpublic int getPageCount()
public boolean isPrintAllowed()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||