PrinterSettings is ignored when printing a document

Setting PrinterSettings is ignored when printing a document.  See attached example app.  For example, say I want to print the first two pages.  I select those values in the printer dialog.  However, the PdfViewer prints all the pages.

How can I get the PrinterSettings that the user selects to be honored when printing the document.

This is similar to your example at https://www.syncfusion.com/kb/4625/how-to-silent-print-a-pdf-document-to-a-specified-printer

Regards,
Arthur

Attachment: Printing_Example_ce6f80b1.zip

12 Replies 1 reply marked as answer

DD Divya Dhayalan Syncfusion Team February 8, 2021 07:34 PM UTC

Hi Arthur, 
 
Thanks for Contacting syncfusion support. 
 
We are able to reproduce the reported issue “the PrintDialog ignored the page range specification while printing” in our end with the provided sample. On analyzed further, we suspect that your requirement is to printing PDF file pages after selecting page range in show dialog. This requirement can be achieved using Pdfviewer Print(true) function which will show the Print Dialog and print the selected pages.  
Please download the modified sample from the below link, 
 
Please let us know if the provided details help to achieve your requirement or if you need any further assistance on this. 
 
Regards, 
Divya 



AB Arthur Butler February 8, 2021 07:52 PM UTC

Thank you for the quick response.  While your example does function, it does not meet my real requirement.  I have a custom print dialog that only shows a sub-set of the installed printers.  I need to be able to take the PrinterSettings from that dialog and apply then to printing of the PdfViewerControl.

Regards,
Arthur


DD Divya Dhayalan Syncfusion Team February 9, 2021 06:05 PM UTC

Hi Arthur, 
 
Thanks for the Update. 
 
Since PrintDocument is pre-fetched with the information of all the pages of PDF document, the custom settings may not be applied to it. However, can you please share more details about all the Printer Settings which you need to be applied when printing from custom print dialog?  
 
This information will be helpful for us to analyze further on this and provide you a better solution. 
 
Regards, 
Divya 



AB Arthur Butler February 9, 2021 07:01 PM UTC

Mainly, we want to be able to define the printer name, the duplex setting, and the from/to pages to print.


DD Divya Dhayalan Syncfusion Team February 10, 2021 06:23 PM UTC

Hi Arthur, 
 
Thanks for the Update. 
 
Currently we are analysing the possibilities to achieve your requirement, we will update further details on 12th February 2021. 
 
Regards, 
Divya 



DD Divya Dhayalan Syncfusion Team February 14, 2021 05:54 AM UTC

Hi Arthur, 
 
Sorry for the inconvenience caused. 
 
We are still checking the possibilities to achieve your requirement. We will update further details on 16th February 2021. 
 
Regards, 
Divya


DD Divya Dhayalan Syncfusion Team February 16, 2021 08:35 AM UTC

Hi Arthur, 

Thanks for your Patience. 

On analyzed further, we found that we can apply the mentioned printer settings (printer name, the duplex setting, and the from/to pages to print) to the PrintDocument property. We have created a sample for this, and it can be downloaded from the below link. 
 
However, when trying the above sample, we could see that the `ToPage` value is not working when printing the PDF pages and we have logged an issue for the same. The patch for this fix is expected to be available on March 2nd, 2021. 

Please find the feedback link below, 

Note: Based on the PdfViewer product version you have used in the sample. We will provide the patch in the version (18.4.0.30). Please let us know if you need the patch in any other version. 

Regards, 
Divya 



AB Arthur Butler February 16, 2021 11:38 PM UTC

Thank you.  I won't need a patch if the fix is in an updated version.


DD Divya Dhayalan Syncfusion Team February 17, 2021 05:41 AM UTC

Hi Arthur, 
 
Thanks for the update. 
 
As per your request, we will include this fix in our Weekly NuGet release which is expected to be available on 2nd March 2021. 
 
Please let us know if you need any further assistance. 
 
Regards, 
Divya 



VS Vikas Sekar Syncfusion Team March 2, 2021 01:08 PM UTC

  
As we mentioned in the previous update, we have included the fix for this issue “`ToPage` value is not working when printing the PDF pages” in our latest weekly NuGet release, so kindly upgrade to latest version v18.4.0.46 to get the issue resolved.   
    
 
Note: Please use the sample which we have provided in our last update to achieve your requirement.  
  
Regards, 
Vikas 


Marked as answer

AB Arthur Butler March 2, 2021 06:23 PM UTC

Thank you.  This works well.


DD Divya Dhayalan Syncfusion Team March 3, 2021 09:15 AM UTC

Hi Arthur, 
 
Most Welcome. 
 
Please let us know if you need any further assistance on this.  
  
Regards, 
Divya

Loader.
Up arrow icon