Changes

Jump to: navigation, search

An Android Studio Custom Document Printing Example

35 bytes added, 15:33, 23 July 2014
no edit summary
As previously outlined, when the onWrite() method is called it is passed an array of 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.
<google>BUY_ANDROID_STUDIO</google>
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