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.
})