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

178
Views
html2 canvas decrase the image quality while rendering

Hi i've been trying to build a template poster creator with html2canvas. When i try to render my canvas, its quilty decrease unexpectedly.

Here is the real canvas photo:

enter image description here

The rendering result is :

enter image description here

This is my capture function to render canvas:

function capture() {
            document.getElementById('fullpage').style.zoom = 3;
            $('#target').html2canvas({
                onrendered: function (canvas) {
            //Set hidden field's value to image data (base-64 string)
                    $('#img_val').val(canvas.toDataURL('image/png',1.0));
            console.log(canvas.toDataURL("image/png",1.0));
            //Submit the form manually
        document.getElementById("showimage").src = canvas.toDataURL('image/png',1.0);
        document.getElementById("image-holder").style.display = "block";
     //document.getElementById("myForm").submit();
                }
            });
     document.getElementById('fullpage').style.zoom = 1;
        }
     

This is the html code :

 <div class = "col-md-8">
        
           <div id = "image-holder" style = "display:none; position:fixed;
              top: 0;
              left: 0;z-index:1000;
              width:100%;
              height:100%;">
              <p onclick = "closeholder()" id = "closeholder" style="font-color:white;">X</p>
              <img id = "showimage" src = ""/>
           </div>

           <form method="POST" enctype="multipart/form-data" action="save.php" id="myForm">
              <input type="hidden" name="img_val" id="img_val" value="" />
           </form>
           
           <div id="target">
              <div id = "main_bg" style = "z-index: 0;position: absolute;height: 100%;width:100%;"></div>
           </div>
        </div>
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!