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

142
Vistas
How can I fill up the paper during printing? Is it possible to fill the entire page with this image?

I am using html2canvas to capture a div on my Calendar and open the image on a new window,then print it. But on the print preview,the image is not filling up the paper.There are always blanks up, down, left and right, I want it to fill the page.

This is set to "Fit to page width": enter image description here And scale 100% is worse: enter image description here Here is my code:

function printCalendar(){
    
            var printMaxWidth = "1420px";
            var printMaxHeight = "890px";
            //Create the option to open a window
            var option = 'width=' + printMaxWidth + ',height=' + printMaxHeight;
            var calendartPrintWindow = window.open("", "", option); 
            
            //Open the document of the window
            calendartPrintWindow.document.open();

            //Html2canvas
            html2canvas(document.querySelector("#calendarContainer")).then(canvas => {
                //Insert the created html document inside it 
                calendartPrintWindow.document.write('<img src="'+canvas.toDataURL()+'"/>');
                //Close the document the window
                calendartPrintWindow.document.close();
                //Print
                setTimeout(function(){calendartPrintWindow.print();},100);}); 
     }

"Fit to page width" looks good but it will be great when the image can fill the entire page.Is there and Ideas?Thanks.

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