Print PDF file in C# - PrintDocumentWithSettings taking a long time to print

@manikantakondepati

The method PrintDocumentWithSettings usually prints the PDF document by applying the specified Page settings. Can you please explain in what perspective you want the details behind this method?

@asad.ali
What is the method “PrintDocumentWithSettings” doing for printing a document to a network printer going thru print server and NOT for a locally configured printer(configured as TCP/IP printer and not going thru print server)?. Is there a difference between these two ways of printing when using Aspose library.

We tried to compare network packets that were captured for the below scenarios:

On an App server, I tried to print a PDF thru print server using adobe reader: 135 packets sent and received when printing from Adobe reader to the print server. Took about 2 seconds to print.

On an App server, I tried to print a PDF thru print server using .Net Aspose API call: 77,000 packets sent and received when printing from application using Aspose to the print server. Took about 45 seconds to print.

On an App server, I tried to print a PDF to local printer (configured as TCP/IP printer and not going thru print server) using .Net Aspose API call- 162 packets sent and received when printing from application using Aspose API to a network printer that was created as local print queue on the app server there by bypassing the Print server. Took about 2 seconds to print.

Considering the above difference, we are wondering why there is so much difference in the number of packets sent to network printer when using Aspose library.

Also, please note that when using Aspose library and trying to print to local printer, for a 2 page PDF document, it is taking approx 2 seconds and for a 37 page PDF document, it takes approx 16 seconds. So that tells me if the number of pages in PDF increase that increases the time taken by aspose library as well. What is an acceptable time it takes for the Aspose library to process a 37 page PDF document?

Please let me know if you have any questions.

@manikantakondepati

PdfViewer.PrintDocumentWithSettings() method is a part of PrintDocument:

  • generate Default PageSettings;
  • generate Default PrinterSettings;
  • call method PrintDocumentWithSettings.

In PrintDocumentWithSettings, you can set some settings (Margins, Copies, PrinterName, etc).

The method works based on PrintDocument from System.Drawing.Printing.

PrintDocument:
Defines a reusable object that sends output to a printer. 

Furthermore, thanks for providing details of the investigation made by you. We have recorded this information along with the earlier logged ticket and will investigate it from this perspective as well. We will surely inform you once we have some updates in this regard.

We apologize for the inconvenience caused.

@asad.ali
Thanks for the information, we are trying to use a UNC path for the printer name attribute and it appears that each time to try to print, the “PrintDocumentWithSettings” method tries to install the driver even thought the printer driver is installed. This driver loading is taking about 40 seconds. How can we adjust the code so that the installed driver is used?

@manikantakondepati

We really regret that we cannot share further feedback without investigating the logged ticket in more detail. We have recorded all the information that you provided and will analyze this case from this perspective. We will let you know once we make some significant progress towards ticket resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

@asad.ali Hello Ali, wishing you a happy new year, it’s been 20 days since your last update and I understand that Aspose works on first come first basis, can we at least get a sense of timeline, as to when this issue could possibly be resolved. We will be forced to look at alternate vendor if this issue is not resolved at the earliest, since the project we are working on is of high priority among upper management. Thank You… looking forward to resolution…

@manikantakondepati

We are afraid that the earlier logged ticket has not been scheduled for investigation yet. Hence, some reliable ETA cannot be shared from our side. However, we have recorded your concerns and logged them under the ticket as well. We will surely consider them during ticket analysis and let you know as soon as we have some investigation results and feedback to share with you regarding ticket resolution or fixing ETA. We greatly appreciate your patience and comprehension in this regard.

We apologize for your inconvenience.