jsPDF Tutorial to Add & Compress Images From URL to PDF Document and Fit to PDF Page Width and Height in Browser Using Javascript

 

 

You can get the width and height of PDF document like below,

Then you can use this width and height for your image to fit the entire PDF document.

Make sure that your image has the same size (resolution) of the PDF document. Otherwise it will look distorted (stretched).

If you want convert px to mm use this link http://www.endmemo.com/sconvert/millimeterpixel.php

Leave a Reply