Class PDFPrintPage
java.lang.Object
com.sun.pdfview.PDFPrintPage
- All Implemented Interfaces:
Printable
-
Field Summary
Fields inherited from interface Printable
NO_SUCH_PAGE, PAGE_EXISTS -
Constructor Summary
ConstructorsConstructorDescriptionPDFPrintPage(PDFFile file) Create a new PDFPrintPage object for a particular PDFFile. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoCancel()Cancel the print job.voidhide()Close the progress dialog.intprint(Graphics g, PageFormat format, int index) voidAn example method to print a file.voidshow(PrinterJob pjob) Show the progress dialog for this print job
-
Constructor Details
-
PDFPrintPage
Create a new PDFPrintPage object for a particular PDFFile.- Parameters:
file- the PDFFile to be printed.
-
-
Method Details
-
printFile
An example method to print a file.- Parameters:
filename- The path of the PDF file to print.setupPaper- true to post a page setup dialog- Throws:
IOException
-
show
Show the progress dialog for this print job- Parameters:
pjob- the PrinterJob representing the print job
-
hide
public void hide()Close the progress dialog. Don't use this method to cancel the print job; usedoCancelinstead. -
doCancel
public void doCancel()Cancel the print job. Disables the cancel button, as it might take a while for the cancel to take effect. -
print
- Specified by:
printin interfacePrintable- Throws:
PrinterException
-