Android.Print.PrintDocumentInfo Class
This class encapsulates information about a document for printing purposes.

See Also: PrintDocumentInfo Members

Syntax

[Android.Runtime.Register("android/print/PrintDocumentInfo", DoNotGenerateAcw=true)]
public sealed class PrintDocumentInfo : Java.Lang.Object, Android.OS.IParcelable, IDisposable

Remarks

This class encapsulates information about a document for printing purposes. This meta-data is used by the platform and print services, components that interact with printers. For example, this class contains the number of pages contained in the document it describes and this number of pages is shown to the user allowing him/her to select the range to print. Also a print service may optimize the printing process based on the content type, such as document or photo.

Instances of this class are created by the printing application and passed to the NoType:android/print/PrintDocumentAdapter$LayoutResultCallback;Href=../../../reference/android/print/PrintDocumentAdapter.LayoutResultCallback.html#onLayoutFinished(android.print.PrintDocumentInfo, boolean) callback after successfully laying out the content which is performed in PrintDocumentAdapter.OnLayout(PrintAttributes, Android.Print.PrintAttributes, Android.Print.PrintAttributes, Android.Print.PrintAttributes, Android.Print.PrintAttributes).

An example usage looks like this:

java Example


 . . .

 public void onLayout(PrintAttributes oldAttributes, PrintAttributes newAttributes,
         CancellationSignal cancellationSignal, LayoutResultCallback callback,
         Bundle metadata) {

        // Assume the app defined a LayoutResult class which contains
        // the layout result data and that the content is a document.
        LayoutResult result = doSomeLayoutWork();

        PrintDocumentInfo info = new PrintDocumentInfo
                .Builder("printed_file.pdf")
                .setContentType(PrintDocumentInfo.CONTENT_TYPE_DOCUMENT)
                .setPageCount(result.getPageCount())
                .build();

       callback.onLayoutFinished(info, result.getContentChanged());
   }

   . . .

 

[Android Documentation]

Requirements

Namespace: Android.Print
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0