I have a div that is pretty crowded. This is mainly a large organizational chart. What I want to do is export all the div content, not the visible part, using the html2canvas library, but I have not been able to achieve it yet. The following code snippet does not display the full content. Is there any way to achieve this?
function export(){ html2canvas( [ document.getElementById('diagram') ], { onrendered: function(canvas) { var dataUrl = canvas.toDataURL(); window.open(dataUrl, "toDataURL() image", "width=800, height=800");
I use the BasicPrimitives library to create organization charts. It takes a div and inserts all the elements into it. Since my chart is moderately large, it overflows from its container. Xhtml code is as follows:
<rich:panel style="float: left; width: 100%;"> <div style="float: left; height:600px; margin-left: 1%; width: 19%; border-style: dotted; border-width:1px;"> Some irrelevant content </div> <div id="diagram" class='diagram' style="float: right; height:600px; width: 59%; border-style: dotted; border-width:1px;"> This is the div all charts are dynamically inserted </div> <div style="float: left; height:600px; margin-left: 1%; width: 19%; border-style: dotted; border-width:1px;"> Some more irrelevant content </div> </rich:panel>
source share