- printJobName
- A name for the new print job which is shown to the user.
- documentAdapter
- An adapter that emits the document to print.
- attributes
- The default print job attributes or null.
Documentation for this section has not yet been entered.
Type Reason Java.Lang.IllegalStateException If not called from an Android.App.Activity. Java.Lang.IllegalArgumentException If the print job name is empty or the document adapter is null.
Creates a print job for printing a Android.Print.PrintDocumentAdapter with default print attributes.
Calling this method brings the print UI allowing the user to customize the print job and returns a Android.Print.PrintJob object without waiting for the user to customize or confirm the print job. The returned print job instance is in a PrintJobInfo.StateCreated state.
This method can be called only from an Android.App.Activity. The rationale is that printing from a service will create an inconsistent user experience as the print UI would appear without any context.
Also the passed in Android.Print.PrintDocumentAdapter will be considered invalid if your activity is finished. The rationale is that once the activity that initiated printing is finished, the provided adapter may be in an inconsistent state as it may depend on the UI presented by the activity.
The default print attributes are a hint to the system how the data is to be printed. For example, a photo editor may look at the photo aspect ratio to determine the default orientation and provide a hint whether the printing should be in portrait or landscape. The system will do a best effort to selected the hinted options in the print dialog, given the current printer supports them.
Note: Calling this method will bring the print dialog and the system will connect to the provided Android.Print.PrintDocumentAdapter. If a configuration change occurs that you application does not handle, for example a rotation change, the system will drop the connection to the adapter as the activity has to be recreated and the old adapter may be invalid in this context, hence a new adapter instance is required. As a consequence, if your activity does not handle configuration changes (default behavior), you have to save the state that you were printing and call this method again when your activity is recreated.