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

246
Views
How i pass a media query or fix width and height using onclick event?

So i convert html page to pdf by using onclick event

My code is:-

function generatePDF() {
    var element = document.getElementById('invoice');

    var doc = {
        filename:     'myfile.pdf',
        image:        { type: 'jpeg', quality: 1 },
        html2canvas:  { dpi:192, letterRendering : true, scale: 2,  text Align: 'center', },
        jsPDF:        { unit: 'pt', format: 'letter', orientation: 'portrait', format: 'a4' },
    };

    html2pdf().set(doc).from(element).save();
}

By using onclick event the page will be downloaded successfully but the alignment of the content is changed. I want to give fix size so the content alignment is not change and also in mobile view the page will be downloaded at that defined fix size.

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!