public override void OnLayout(PrintAttributes oldAttributes, PrintAttributes newAttributes, CancellationSignal cancellationSignal, LayoutResultCallback callback, Bundle extras) { document = new PrintedPdfDocument(context, newAttributes); CalculateScale(newAttributes); var printInfo = new PrintDocumentInfo .Builder("pdf-test.pdf") .SetContentType(PrintContentType.Document) .SetPageCount(1) .Build(); callback.OnLayoutFinished(printInfo, true); }
public override void OnLayout (PrintAttributes oldAttributes, PrintAttributes newAttributes, CancellationSignal cancellationSignal, Android.Print.PrintDocumentAdapter.LayoutResultCallback callback, Bundle extras) { if (cancellationSignal.IsCanceled) { callback.OnLayoutCancelled (); return; } PrintDocumentInfo pdi = new PrintDocumentInfo.Builder (PrintService.pdfName).SetContentType (Android.Print.PrintContentType.Document).Build (); callback.OnLayoutFinished (pdi, true); }