angularjs - PDF generation using PDFmake library fails on IOS devices -


currently build hybrid app using cordova ionic, 1 of functionality generate pdf invoices, have used html2canvas , pdfmake libraries produce pdf. code works fine in andriod devices not in ios devices, seems documeent.getelelmentbyid('id') function causing issue. if commented out code works fine.

i need read dom element ionic view controller generate image using html2canvas , send server generate pdf.

here code: //angular.element(document.getelementbyid('exportthis')

$scope.generatepdf = function () {  var htmlmarkup = angular.element(document.queryselector("#exportthis"));             html2canvas(htmlmarkup, {                 onrendered: function (canvas) {                     var data = canvas.todataurl();                     var docdefinition = {                         content: [{                             image: data,                             width: 500,                         }]                     };                     } pdfmake.createpdf(docdefinition).download("submissioninformation.pdf");                     const pdfdocgenerator =  pdfmake.createpdf(docdefinition); })} 

is there way read div tag ionic view controller without using document.getelementbyid or not using jquery?

here div tag:

 <div id="exportthis" ng-model="exportdata">                  <!--</label>-->                   <label class="item item-input">payment due date:                       {{payvm.paymentduedate}}                   </label>  </div>  

with few more labels


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -