pdfMake generates Empty PDF for large content!

934 views
Skip to first unread message

venkatesh venky

unread,
Jan 5, 2018, 5:23:35 AM1/5/18
to Angular and AngularJS discussion
I am using angularjs here pdfmake generates empty pdf for large content here is my code

$scope.exportToPdf = function () {
    $timeout(function () {
    html2canvas(document.getElementById('customers'), {
        onrendered: function (canvas) {
            var data = canvas.toDataURL();
            var docDefinition = {
                content: [{
                    image: data,
                    width: 500,
                    pageSize: 'A5',                 
                    pageOrientation: 'landscape',
                }]
            };
            pdfMake.createPdf(docDefinition).download('file.pdf', function (){
                alert('your pdf is done');
            });
        }
    });
    }, 100);
}

Sander Elias

unread,
Jan 6, 2018, 3:20:53 AM1/6/18
to Angular and AngularJS discussion
Hi Venkatesh,

This sounds like a bug in your html2canvas library. Perhaps ask in their support system?

Regards
Sander
Reply all
Reply to author
Forward
0 new messages