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

173
Views
Why won't my page render or export using html2canvas?

My first post here, so forgive any etiquette slips.

I am creating a page whereby the user can customize a card...that functionality is not a problem. But I need to export an image of the card, and cannot make that happen. I have tried the code from the html2canvas site, among many other versions, trying even to render the whole document, from this page and others. But I get nothing, save for a few errors I don't understand.

Here's the page: https://interrobangtype.co/resources/business-card-maker/ Upon clicking the submit button, I see this error:

Uncaught (in promise) DOMException: CanvasRenderingContext2D.createPattern: Passed-in canvas has height 0

My code specific to this function is here:

<canvas class='hidden card' style='width: 3.5in; height: 2in;'></canvas>
<button onclick="Submit();" class='download-card button' id='download-card' >Submit</button>
                        
<script type="text/javascript">
var Submit = function() {
html2canvas(document.body, {
onrendered: function(canvas) {
$('canvas.card').removeClass('hidden');
}
});
}
</script>

Any insight? I tried it by letting the plugin append the canvas as well.

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!