Viscomsoft UWP PDF Viewer SDK

PDFPrintManager.ShowAsync Method

 

Show the preview print dialog.
 
 C#

public async Task ShowAsync()

 


No Parameter


Namespace: Viscomsoft.UWP.PDFViewerSDK;

No Return Value


Example

   

[C# Syntax] 
using Viscomsoft.UWP.PDFViewerSDK;
   
private PDFPrintManager _printManager = new PDFPrintManager();
private bool _bRegisterPrint = false;

    DocumentFactory factory = new DocumentFactory();

    IDocument doc = factory.CreateDocument(file.Name);

    bool opened = await doc.OpenAsync(file);

   

    _pdfDisplayManager = new PDFDisplayManager();

    _pdfDisplayManager.Width = (int)Window.Current.Bounds.Width;

    _pdfDisplayManager.Height = (int)Window.Current.Bounds.Height;

    _pdfDisplayManager.Document = doc;

    _printManager.Document = doc;

    if (_bRegisterPrint == false)
    {

     _printManager.RegisterForPrinting();
    
     _bRegisterPrint = true;
    }

    _pdfDisplayManager.GotoPage(1);

    uiViewPanel.Child = createScrollViewControl();

private void btnPrint_Click(object sender, RoutedEventArgs e)
{
   if (_pdfDisplayManager == null)
   return;

   if (_printManager == null)
   return;

   _printManager.CurrentPage = _pdfDisplayManager.CurrentPage;
   _printManager.ShowAsync();
}