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

144
Views
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
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!