Added in API level 19

PrintDocument

class PrintDocument
kotlin.Any
   ↳ android.printservice.PrintDocument

This class represents a printed document from the perspective of a print service. It exposes APIs to query the document and obtain its data.

Note: All methods of this class must be executed on the main application thread.

Summary

Public methods
ParcelFileDescriptor?

Gets the data associated with this document.

PrintDocumentInfo

Gets the PrintDocumentInfo that describes this document.

Public methods

getData

Added in API level 19
fun getData(): ParcelFileDescriptor?

Gets the data associated with this document.

Note: It is a responsibility of the client to open a stream to the returned file descriptor, fully read the data, and close the file descriptor.

Return
ParcelFileDescriptor? A file descriptor for reading the data. This value may be null.

getInfo

Added in API level 19
fun getInfo(): PrintDocumentInfo

Gets the PrintDocumentInfo that describes this document.

Return
PrintDocumentInfo The document info. This value cannot be null.