Gnostice PDFOne
Pro. Ed. v5.0.0


com.gnostice.pdfone
Interface PdfPrintPageHandler


public interface PdfPrintPageHandler

This interface defines run-time events that occur when page is printed. By handling this events, the page contents can be pre-processed before it is actually sent to printer.


Method Summary
 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.
 

Method Detail

beforePrintingOnGraphics

public 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. 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.

Parameters:
g - printer graphics object representing the page
pageNum - contents of the page
pdfPage - PdfPage object of the page

printingOnGraphics

public 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. 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.

Parameters:
printingPageNum - number of the page that is being rendered
pageCount - total number of pages that will be sent to the printer for printing

afterPrintingOnGraphics

public 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. 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.

Parameters:
g - printer graphics object representing the page
pageNum - number of the page
pdfPage - PdfPage object of the page

cancelPrinting

public 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. 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.

Parameters:
numOfPrintedPages - number of pages that have been printed
totalPagesIssued - total number of pages in the print job
Returns:
whether the print job needs to be cancelled

Gnostice PDFOne
Pro. Ed. v5.0.0

To contact our support team, send an e-mail to support@gnostice.com.
 
© 2010 Gnostice Information Technologies Private Limited. All rights reserved.
www.gnostice.com