Search code examples
javascriptangularpdfkendo-uiacrobat

An error exists on this page. Acrobat may not display the page correctly. kendo.drawing.exportPDF


I'm having an issue with a PDF generation made by kendo.drawing.exportPDF library in an angular 6 app, the code goes as it follows :

kendo.drawing.drawDOM($("#job-container"))
.then(function(group) {
    // Render the result as a PDF file
    return kendo.drawing.exportPDF(group, {
        paperSize: "auto",
        margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" }
    });
})
.done(function(data) {
    // Save the PDF file
    kendo.saveAs({
        dataURI: data,
        fileName: "Jobs.pdf",
        proxyURL: "https://demos.telerik.com/kendo-ui/service/export"
    });
    //self.showPagTop = true;
});

The point is that I'm able to see it without any issues in Chrome Browser built-in PDF viewer but I'm not seeing it well rendered on Adobe reader version 11.0.23. At this point I don't even know if it could be a kendo.drawing problem or an acrobat/adobe issue.

Thanks in advance for anyone who could help!!


Solution

  • There is a limit on 5000px. I solved this problem with a4 multipage:

    draw.drawDOM($container, {
                    paperSize: "A4",
                    margin: { top: "1cm", left: "1cm", right: "1cm", bottom: "1cm" },
                    scale: 0.5
                })
                .then(function (root) {
                    return draw.exportPDF(root, {
                        multiPage: true
                    });
                })
                .done(function (data) {
                    kendo.saveAs({
                        dataURI: data,
                        fileName: "document.pdf"
                    });
                });