Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jspdf addimage auto height

// You can get the width and height of PDF document like below,
let doc = new jsPDF("p", "mm", "a4");
let width = doc.internal.pageSize.getWidth();
let height = doc.internal.pageSize.getHeight();

// Then you can use this width and height for your image to fit the entire PDF document.
let imgData = 'data:image/jpeg;base64,/9j/4AAQSkZJ......';
doc.addImage(imgData, 'JPEG', 0, 0, width, height);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jspdf #addimage #auto #height
ADD COMMENT
Topic
Name
5+9 =