1

I am using html2canvas to convert the div into canvas. My DIV contain the table and each td contain the image. The canvas is getting successfully created but every image shows white space at the bottom of it.

Is there any other way to convert DIV into CANVAS?

Anant Jadhav
  • 55
  • 11

2 Answers2

1

Yes I got the solution, just style="display:block" for every image.

Anant Jadhav
  • 55
  • 11
0

Yes, here's one alternative to using html2canvas to render all/part of a webpage.

You can use a "headless browser" on your server to capture a webpage into an image. A headless browser can render the contents of a webpage into an image without the security restrictions that apply to html2canvas.

I recommend PhantomJS because it uses Webkit and therefore delivers compatibility with modern browsers: http://phantomjs.org/screen-capture.html

markE
  • 102,905
  • 11
  • 164
  • 176
  • But this will capture whole screen and I want to capture only the specific div of the page. – Anant Jadhav May 30 '15 at 07:16
  • You can capture a specific div on the page with PhantomJS: http://stackoverflow.com/questions/11917042/how-to-render-part-of-a-page-with-phantomjs – markE May 30 '15 at 14:51