PdfDocumentView print only required pages

I have multiple pages of pdf loaded into PdfDocumentView and when I call PdfDocumentView.Print(), it prints all pages. Is there anyway to print only required pages, like page number 2 and 3 only ?


1 Reply

KG Krithika Ganesan Syncfusion Team November 25, 2024 09:46 AM UTC

Hi John,


In the WPF PdfDocumentView, you can use the PrintFromPage and PrintToPage APIs to print a specific range of PDF pages. For your reference, we have provided a code snippet and a sample below to demonstrate how to print a specific range of pages.


private void Button_Click(object sender, RoutedEventArgs e)

{

     pdfView.PrintFromPage = 2;

     pdfView.PrintToPage = 3;

     pdfView.Print("Microsoft Print to PDF");

}


Regards,

Krithika


Attachment: PdfViewerWPF_2d339690.zip

Loader.
Up arrow icon