Articles in this section
Category / Section

How to supports silent printing page range in WPF PDFViewer?

1 min read

WPF PDFViewer does not support to Silent printing particular page range. However, you can achieve this by loading a PDF Document in the PdfLoadedDocument and importing the necessary page range to be printed to a new PdfDocument. Then the resultant document is loaded into the PdfDocumentView and you can print the particular page range of the document.

You can refer to the following code example to print document in particular page range.

C#

PdfDocumentView pdfdocumentview = new PdfDocumentView();
//Load the document in PdfLoaded document
PdfLoadedDocument loadeddocument = new PdfLoadedDocument("../../Data/Manual.pdf");
 
//create an instance of PdfDocument
PdfDocument document = new PdfDocument();
 
//Import the page you need to print to the pdfdocument
document.ImportPageRange(loadeddocument, from, to);
 
//save the document in a memory stream
MemoryStream stream = new MemoryStream();
document.Save(stream);
 
//load the pdfdocumentview with the memory stream
pdfDocumentview.Load(stream);
 
//Prints selected range of pages
pdfDocumentview.Print();

View sample in GitHub.

Conclusion

I hope you enjoyed learning about how to supports silent printing page range in WPF PDFViewer.

 You can refer to our WPF PDF Viewer feature tour  page to know about its other groundbreaking feature representations. You can also explore  documentation to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied