DrawToWeb hangs browser

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v7)  /  DrawToWeb hangs browser

DynamicPDF CoreSuite for .NET (v7) Forum

 Jan 23 2017 10:40 AM
I have a .Net web app that allows the user to select a range of notes. Now that we have lots of records in the database users are choosing large ranges. We first noticed that Chrome and FireFox seemed to hang but IE would eventually return the PDF using myPDF.DrawToWeb(docName);. But now even IE seems to hang. I don't think it is a size issue or a certain number of records since it seems to do this with anywhere from 100 to 150 page documents. I think it just times out. I get no error at the browsers. Just spins for ever. I can roll back the range a bit and get the document. I have also confirmed it is not bad data as I create a PDF from any range as long as I do them in smaller ranges.

Not sure how to handle this. Any suggestions on handling large PDF file creations using DrawToWeb() or a better approach?
 Jan 23 2017 4:44 PM
Posted by a ceTe Software moderator
Hello,

As you are able to generate PDFs for smaller ranges of your data it is possible that the larger data ranges are producing larger PDFs that are taking time and your web page is timing out while the PDF is being generated. to verify, try and increase the web page time out and see if that successfully loads the PDF generated using large data ranges.

There are two parts in the execution of DrawToWeb method - generation of the PDF and transmission of those PDF bytes to the browser. The PDF is held in memory as it is being generated and once the PDF generation is finished it is sent to the browser. Time taken to generate the PDF depend on your PDF generation code, size of the PDF being generated and the available resources. Please review the performance considerations topic and check your code to see if there are any improvements you can make with regards to creating the PDF. As you mentioned that your database has grown in size, you may also want to take a look at the performance of your database queries that you use in PDF generation code. Speeding up the data retrieval part should help the overall performance.

Thanks,
ceTe Software Support Team.
 Jan 24 2017 11:58 AM
Thanks for the info. I could not find any help under performance consideration but I did resolve the hang issue. Although I was not receiving any errors my SQL query would take around 33 seconds to complete for the large ranges and the timeout was defaulted to 30. I increased the connection timeout and command timeout and after about 45-60 seconds the PDF is generated without hanging. This solved my urgent needs. Next I will address the query and see if I can cut execution time down. The database engine tuning advisor only found a 7% increase but I think I can rethink the design for better performance.

All times are US Eastern Standard time. The time now is 11:45 PM.