public override void OnLayout(PrintAttributes oldAttributes, PrintAttributes newAttributes, CancellationSignal cancellationSignal, LayoutResultCallback callback, Bundle extras) { if (cancellationSignal.IsCanceled) { callback.OnLayoutCancelled(); } else { PrintDocumentInfo.Builder builder = new PrintDocumentInfo.Builder(StatsActivity.filename); builder.SetContentType(PrintContentType.Document).SetPageCount(PrintDocumentInfo.PageCountUnknown).Build(); callback.OnLayoutFinished(builder.Build(), !newAttributes.Equals(oldAttributes)); } }
public override void OnLayout(PrintAttributes oldAttributes, PrintAttributes newAttributes, CancellationSignal cancellationSignal, LayoutResultCallback callback, Bundle extras) { if (cancellationSignal.IsCanceled) { callback?.OnLayoutCancelled(); } else { var builder = new PrintDocumentInfo.Builder("filename.pdf"); builder.SetContentType(PrintContentType.Document) .SetPageCount(PrintDocumentInfo.PageCountUnknown); callback.OnLayoutFinished(builder.Build(), !(newAttributes == oldAttributes)); } }