problem implementing html2canvas
See original GitHub issueI have made the simplest of scripts to try out html2canvas, but can’t get it working. After consulting the web and these forums for hours, I have no other choice but bother you with this. This is my php file:
<?php
echo '<! DOCTYPE html>';
echo '<html>';
echo '<head>';
echo '<title>TESTIT</title>';
echo '<script type="text/javascript" src="jquery-1.8.0.min.js"></script>';
echo '<script type="text/javascript" src="html2canvas.js"></script>';
echo '<script type="text/javascript" src="jquery.plugin.html2canvas.js"></script>';
?>
<script type="text/javascript">
$('body').html2canvas();
var queue = html2canvas.Parse();
var canvas = html2canvas.Renderer(queue,{elements:{length:1}});
var img = canvas.toDataURL();
window.open(img);
</script>
<?php
echo '</head>';
echo '<body>';
echo '<h1>THIS IS GREAT</h1>';
echo 'This is a test';
echo '</body>';
echo '</html>';
?>
In Firebug console I get : TypeError: html2canvas.Parse is not a function What am I doing wrong? YB
Issue Analytics
- State:
- Created 11 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Problem generating image using html2canvas #35 - GitHub
Hello eveyone. I have a problem with the generation of image of jsGantt Using the instructions: var wg = Ext.get("GanttChartDIVchartTableh") ...
Read more >html2canvas not working at all - Stack Overflow
Here is the code which isn't working. Basically I'm allowing the user to edit some text in the div and then display its...
Read more >html2pdf.js | Client-side HTML-to-PDF rendering using pure JS.
Known issues. Rendering: The rendering engine html2canvas isn't perfect (though it's pretty good!). If html2canvas isn't rendering your content correctly, ...
Read more >Export React components as images using html2canvas
Learn how to use html2canvas to export React components as images. This can be helpful for exporting multiple images from a page.
Read more >Options - html2canvas
Name Default Description
logging true Enable logging for debug purposes
width Element width The width of the canvas
height Element height The height of the canvas...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To render an element with html2canvas, simply call:
html2canvas( [ element ], options);
To access the created canvas, provide the onrendered event in the options which returns the canvas element as the first argument, as such:
Hi @singhamit0002 Welcome!
Your question sounds like a difficulty and its “NOT A BUG” in “html2canvas” therefore the right time to make this sort of question is spot on: http://stackoverflow.com/questions/tagged/html2canvas (as explained in the “html2canvas” documentation in link named “Questions”)
Good luck!