Changes

Jump to: navigation, search

An Android Custom Document Printing Tutorial

1 byte removed, 21:14, 6 January 2014
no edit summary
== Checking a Page is in Range ==
As previously outlined, when the onWrite() method is called it is passed an array of PrintRange PageRange objects indicating the ranges of pages within the document that are to be printed. The PageRange class is designed to store the start and end pages of a page range which, in turn, may be accessed via the getStart() and getEnd() methods of the class.
When the onWrite() method was implemented in the previous section, a call was made to a method named pageInRange(), which takes as arguments an array of PageRange objects and a page number. The role of the pageInRange() method is to identify whether the specified page number is within the ranges specified and may be implemented within the MyPrintDocumentAdapter class in the CustomPrintActivity.java class as follows:

Navigation menu