Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

207
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda