public interface PdfPrintPageHandler
| Modifier and Type | Method and Description |
|---|---|
void |
afterPrintingOnGraphics(Graphics g,
int pageNum,
PdfPage pdfPage)
Called by the print methods in
PdfPrinter after a page
is printed to the printer's graphics object representing the
page. |
void |
beforePrintingOnGraphics(Graphics g,
int pageNum,
PdfPage pdfPage)
Called by the print methods in
PdfPrinter before a page
is printed to the printer's graphics object representing the
page. |
boolean |
cancelPrinting(int numOfPrintedPages,
int totalPagesIssued)
Called by the print methods in
PdfPrinter after a page
is printed and returns whether rest of the print job needs to be
cancelled. |
void |
printingOnGraphics(int printingPageNum,
int pageCount)
Called by the print methods in
PdfPrinter when a page
is being printed to the printer's graphics object for the page. |
void beforePrintingOnGraphics(Graphics g, int pageNum, PdfPage pdfPage)
PdfPrinter before a page
is printed to the printer's graphics object representing the
page. Use this method to write to the graphics object before
the page contents are actually printed. Content written by this
event will be overlaid by actual content from the page.g - printer graphics object representing the pagepageNum - contents of the pagepdfPage - PdfPage object of the pagevoid printingOnGraphics(int printingPageNum,
int pageCount)
PdfPrinter when a page
is being printed to the printer's graphics object for the page.
Use this method to keep track of the page that is being printed
and the total count of the pages that will be sent to the
printer.printingPageNum - number of the page that is being renderedpageCount - total number of pages that will be sent to the
printer for printingvoid afterPrintingOnGraphics(Graphics g, int pageNum, PdfPage pdfPage)
PdfPrinter after a page
is printed to the printer's graphics object representing the
page. Use this method to write to the graphics object after
page contents have been printed. Content written by this event
will overlay actual content from the page.g - printer graphics object representing the pagepageNum - number of the pagepdfPage - PdfPage object of the pageboolean cancelPrinting(int numOfPrintedPages,
int totalPagesIssued)
PdfPrinter after a page
is printed and returns whether rest of the print job needs to be
cancelled. Return true to cancel the print job.
Return false to continue the print job without any
change. Also, use this method to keep track of the number of pages
that have been printed and the total number of pages in the print
job.numOfPrintedPages - number of pages that have been printedtotalPagesIssued - total number of pages in the print job