We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Print a pdf document usef PdfViewerControl

Thread ID:





115709 Jan 31,2014 08:34 AM UTC Feb 3,2014 08:41 AM UTC WinRT 1
Tags: General
Laurent De Cant
Asked On January 31, 2014 08:34 AM UTC


I'm using PdfViewControl to display a pdf document. Once the viewer is loaded, I set the ViewMode property to FitWidth in order to display the document in a full screen fashion.

Then, when the user clicks a button, I get the pages using GetPages method provided by PdfViewControl and add them to the PrintDocument using SetPreview method.

The problem is that the document does not occupies all the available space (see attachment) on the sheet of paper and the image is higly pixelated.

Here is the code I use to initialize the viewer:

    var pdfBytes = await file.ToBytes();
    var pdfDocument = new PdfLoadedDocument(bytes);
    pdfViewer = new SfPdfViewerControl();
    pdfViewer.Loaded += (sendere=>
        var viewer = sender as SfPdfViewerControl;
        viewer.ViewMode = PageViewMode.FitWidth;

And here is the code I use to print the document:

    var pageCount = pdfViewer.PageCount;
    var pages = pdfViewer.GetPages(0pageCount100);
    var otherPages = pdfViewer.GetPages(0pageCount300);
    _document.SetPreviewPageCount(pageCount + 1PreviewPageCountType.Final);
    var pdfDocument = pdfViewer.ItemsSource as PdfDocument;
    for (int i = 0i < pageCount + 1i++)
        _pages[i= pages[i];
        _document.SetPreviewPage(i + 1pages[i]);

Any idea?




Suresh M [Syncfusion]
Replied On February 3, 2014 08:41 AM UTC

Hi Laurent,


Thank you for your interest in Syncfusion products.


Can you please provide a simple sample to reproduce the issue, that would be more helpful for us to further investigate on the issue reported.


Please let us know if you need any further assistance.





This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon