BoldDeskWe are launching BoldDesk on Product Hunt soon.
Learn more & follow us.
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 += (sender, e) =>
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(0, pageCount, 100);
var otherPages = pdfViewer.GetPages(0, pageCount, 300);
_document.SetPreviewPageCount(pageCount + 1, PreviewPageCountType.Final);
var pdfDocument = pdfViewer.ItemsSource as PdfDocument;
for (int i = 0; i < pageCount + 1; i++)
_pages[i] = pages[i];
_document.SetPreviewPage(i + 1, pages[i]);
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.
us know if you need any further assistance.