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

197
Views
jsPDF: DIV container large front - half cut off

I have the following:

<a class="button" onclick="demoFromHTML()">Generate PDF</a>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.min.js"></script>

<script>
    function demoFromHTML() {
        var pdf = new jsPDF('p', 'mm', [297, 210]);
        source = jQuery('.wpforms-entry-preview-table_compact')[0];
        specialElementHandlers = {
            '#bypassme': function (element, renderer) {
                return true
            }
        };
        margins = {
            top: 20,
            bottom: 20,
            left: 20,
            width: 572
        };
        pdf.fromHTML(
        source,
        margins.left,
        margins.top,
            'width': margins.width,
            'elementHandlers': specialElementHandlers
        },

        function (dispose) {
            pdf.save('Test.pdf');
        }, margins);
    }
 </script>

The margins seem to work fine - but for some reason the actual DIV I am trying to print, is half way across on the page and half cut off, plus the font size is huge.

Am I missing something? Is there a setting to make the font size smaller? The actual div I am trying to print is 2 columns.

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!