Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

230
Views
Jspdf height of PDF not working for images with long height
    var img = new Image();
    img.src = "data:image/jpeg;base64,/......" ;
var doc = new jsPDF();
var width = doc.internal.pageSize.getWidth;
var height = doc.internal.pageSize.getHeight;
 doc.addImage(img, 'JPEG', 0, 0, width, height);
  doc.save('img.pdf'); 

I am using above code to currently convert images into pdf long images like this https://cdn.black-clover.org/file/sugois/Reality-Quest/Chapter-1/03.jpg doesn't gets its height in pdf it only shows a part of image in pdf, any way to get its full height content while keeping the width on same ratio, you can check the demo by compiling the code above. Thanks in advance. You can check the fiddle here:- https://jsfiddle.net/5v91exfs/

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!