to top
Android APIs
public final class

PrintDocument

extends Object
java.lang.Object
   ↳ android.printservice.PrintDocument

Class Overview

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 getData()
Gets the data associated with this document.
PrintDocumentInfo getInfo()
Gets the PrintDocumentInfo that describes this document.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public ParcelFileDescriptor getData ()

Added in API level 19

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.

Returns
  • A file descriptor for reading the data.

public PrintDocumentInfo getInfo ()

Added in API level 19

Gets the PrintDocumentInfo that describes this document.

Returns
  • The document info.