jspdf Checking pdf file size -


i want check pdf file size jspdf.js script. need display on screen before downloading file. there possibilities?

function demofromhtml(x = false) {                     var pdf = new jspdf('p', 'pt', 'letter');                     source = $('#print')[0];                      specialelementhandlers = {                         '#bypassme': function (element, renderer) {                             return true                         }                     };                     margins = {                         top: 80,                         bottom: 60,                         left: 40,                         width: 522                     };                     pdf.fromhtml(                         source,                          margins.left,                          margins.top, {                              'width': margins.width,                             'elementhandlers': specialelementhandlers                         },                          function (dispose) {                              if(x){                                 pdf.output('dataurlnewwindow');                             }else{                                 pdf.save('<?php the_title() ?>.pdf');                             }                         }, margins                     );                 } 

i've found solution, pretty simple. maybe use it:

pdf.output().length;


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -