Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

240
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda