This is a migrated thread and some comments may be shown as answers.

drawDOM huge piece of html

5 Answers 110 Views
Drawing API
This is a migrated thread and some comments may be shown as answers.
Daryl Shenner
Top achievements
Rank 1
Daryl Shenner asked on 29 Dec 2016, 06:40 PM

I have a requirement where it's necessary print a piece html as PDF, everything goes well when the html is not so large, but when the size is bigger, more elements to get rendered the performance suffers, the window keeps unresponsive for some time span, that's a real problem because some browsers as IE11+ crashes when the main thread is blocked for several time, the same for FireFox, Is there any way to avoid the main thread get locked?

Here the code

01.//Here the main thread is blocked in certain time span although it is supposed to be a async promise
02.kendo.drawing.drawDOM($(selector), {
03.  paperSize: "A4",
04.  margin: "1cm",
05.  multiPage: true,
06.})
07..then(function (group) {
08.   return kendo.drawing.exportPDF(group);
09.}).done(function (data) {
10.     kendo.saveAs({
11.      dataURI: data,
12.      fileName: "file.pdf",
13.      proxyURL: "/ExportToPDF"
14.     });                        
15. })

5 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 02 Jan 2017, 09:35 AM
Hello Daryl,

This is not a known issue and it was not observed in our testing scenarios.

Could you please provide a runnable example, so we can inspect it and check if there are optimisations which can be made?

Also, what is the size of the PDF file when exported from Chrome(assuming that it is not crashing on Chrome)? This will help us determine how big is the HTML which has to be exported.

I will be expecting the additional information to continue the investigation.

Thank you in advance.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
0
Bat-Erdene
Top achievements
Rank 1
answered on 09 Jan 2019, 03:18 PM
I confirm that I am having the exact same behaviour described above. We have a report which can contain thousands of pages. While the is running I can not do anything on the single page app. In addition, it would help if there was a way to cancel the operation as sometimes it just going to take too long. In order produce issue, you can try adding lots of <pre> and span tags for lots of elements.
0
Konstantin Dikov
Telerik team
answered on 11 Jan 2019, 06:50 AM
Hello Bat-Erdene,

As a workaround for this problem you could allow the end user to open the content that will be exported on a separate window/tab, which will keep the current app responsive. 

Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
PAMELA LOGGINS
Top achievements
Rank 1
answered on 08 Feb 2019, 04:29 PM
I can also confirm the same issue as above. My issue is not with the blocking of the main thread, but it seems like the script will just never create the file to download if there is a lot of data being drawn. I currently have a report about 2500 pages long with nothing more than a little text on each page, and the report will not export to pdf. The webpage just crashes. 
0
Konstantin Dikov
Telerik team
answered on 12 Feb 2019, 01:40 PM
Hello Pamela,

Could you please elaborate if you have included the Pako library as suggested in the following help topic:
Looking forward to your reply.


Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Drawing API
Asked by
Daryl Shenner
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Bat-Erdene
Top achievements
Rank 1
Konstantin Dikov
Telerik team
PAMELA LOGGINS
Top achievements
Rank 1
Share this question
or