Website occasionally hangs when using Aspose.PDF to print to a printer

Support,

We are using the following code to print a PDF file. It works most of the time, however occasionally this block of code hangs and the printing function and at that point no one can print any longer from the website and we must do an IISRESET to make printing function again.

Please let me know what is wrong with the Aspose.PDF printing function. The problem according to our logging is that it stops at this line:

viewer.PrintDocumentWithSettings(pgs, ps);viewer.PrintDocumentWithSettings(pgs, ps);

It never resumes processing after using that command.

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.Pdf.

Please share your template PDF file with us and you may try the latest version of Aspose.Pdf for .NET v7.4 (if you are using an older version).

Sorry for the inconvenience,

Attached is example pdf file.

Like I said, you have to run IIS website. The specifics of this website are as follows:

  • .NET 4.0 ASP.NET webforms website, using IIS 7.5 integrated mode running under a domain account.
  • Printing to a printer on our print server

Issue does not happen 100% of the time. It seems that when it does however, we have to do IISRESET for it to work again.

We are using Aspose.PDF 7.2.

Can't upgrade at this time due to large testing effort required. Please help me fix it with Aspose.PDF 7.2.

THanks.

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the details.

I tested your issue with the latest version of Aspose.Pdf for .NET and I am unable to reproduce your mentioned issue. I created a Web Application (.NET 4.0 under IIS 7.5) and performed the print process for more than 10 times and it executed successfully. I would request you to create a sample application to replicate the issue and share with us.

Also, as per your code, you are setting the license of Aspose.Pdf for .NET on every print command which is not recommended. You only need to set the license once (may be you can place it in Application_Start event).

Regarding your request of fixing the issue in v7.2, I would like to inform you about our company policy that if we identify the issue, we fix and include the fix in the latest version of the product. Bug fixing is not don in any older version.

Sorry for the inconvenience,