Questions tagged [html2canvas]

html2canvas is a JavaScript HTML-rendering library that lets you take "screenshots" of webpages based on the DOM.

From the official site:

This script allows you to take "screenshots" of webpages or parts of it, directly on the users browser. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page.

1794 questions
13
votes
6 answers

Angular2 - Generate pdf from HTML using jspdf

For a project I'm working on I need to be able to generate a PDF of the page the user is currently on, for which I'll use jspdf. Since I have a HTML I need to generate a PDF with, I'll need the addHTML() function. There are a lot of topic about…
FlorisdG
  • 754
  • 5
  • 11
  • 31
12
votes
2 answers

How encode in base64 a file generated with jspdf and html2canvas?

i'm trying encode the document generated in the attached code, but nothing happens, not generate error but neither encodes the file, and the ajax request is never executed what is the correct way? …
ya va
  • 133
  • 1
  • 1
  • 5
12
votes
4 answers

html2canvas not capturing image

html2canvas.js not capturing image. it leaves white space where the image occurs. function capture() { html2canvas(document.body, { allowTaint: true, logging:true, onrendered: function(canvas) { imagestring =…
Karthikeyan
  • 1,119
  • 1
  • 15
  • 33
11
votes
7 answers

Html2Canvas image is getting cut

I use Html2Canvas and then jsPdf to export the image. This is the function: function exportPdf() { content = $("#print"); var useWidth = content.prop('scrollWidth'); var useHeight = content.prop('scrollHeight'); debugger; …
user3442470
  • 409
  • 2
  • 6
  • 19
11
votes
1 answer

Import long html into split PDF

My scenario is: On clicking a button, import datas on a html into a PDF file. Since this PDF must have some complicated required style, so my first step is to transfer this page into a image using html2canvas.js and then import this image to a PDF…
drizzt83s
  • 144
  • 9
11
votes
3 answers

html2canvas javascript screenshot and upload

Would it be possible to use html2canvas (This) to take a picture of the user`s screen but also upload the image, get the upload link and send it with ajax to the webserver? if so, how can i do this?
maria
  • 207
  • 5
  • 22
  • 56
11
votes
8 answers

How to display an image in two pages in PDF using jsPDF?

I have a html page. In which I have a button , whenerever I click this button it will convert the entire html page into data image using html2canvas and placed it into PDF using jsPDF library. The javascript which I am using is…
Manoj Nayak
  • 2,449
  • 9
  • 31
  • 53
11
votes
2 answers

On render in Html2Canvas, the page is scrolled to the top

I am using the html2canvas library, using the following code: html2canvas(document.body, { onrendered: function(canvas) { document.body.appendChild(canvas); } }); When onrendered is fired, the page is automatically scrolled to the top.…
igolka97
  • 288
  • 2
  • 11
11
votes
5 answers

html and Svg to Canvas javascript

This is my html code. I want to convert it canvas image. html2canvas($("#Contents"), { …
user2622044
  • 185
  • 3
  • 4
  • 14
10
votes
3 answers

How to upload a screenshot using html2canvas?

Using html2canvas how can I save a screen shot to an object? I've been exploring the demos, and see that the function to generate the screenshot is generated as follows: $(window).ready(function() { ('body').html2canvas(); }); What I've…
djq
  • 14,810
  • 45
  • 122
  • 157
10
votes
3 answers

DOMException: Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot': Sharing constructed stylesheets in multiple documents is not allowed

Encountered when using html2canvas: DOMException: Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot': Sharing constructed stylesheets in multiple documents is not allowed html2canvas(document.getElementById('qr-code-content'),…
hudaxin
  • 101
  • 1
  • 3
10
votes
5 answers

html2canvas to render document PDF with css styling using angular2/typescript

How to generate an output file PDF using html2canvas with angular2 I tried to import the file html2canvas typescript and made a declaration like this to use it declare let html2canvas: Html2CanvasStatic; but I get html2canvas is not defined…
khalil _diouri
  • 791
  • 3
  • 12
  • 34
10
votes
1 answer

html2canvas not working with pseudo elements

I am trying to take a screenshot by using html2canvas using ionicframework. The html2canvas works in every way except those that i have classes with :before. such as CSS .e_amount::before{ content: "$"; } Before taking the screen shot it looks…
Gene Lim
  • 1,068
  • 2
  • 14
  • 36
10
votes
2 answers

html2canvas not rendering image (externally hosted images)

I have created a game in which users pick 4 images from 4 separate slideshows to create a composite image, which I then want to be able to export to a 'gallery' function on my site. I am attempting to use html2canvas but am encountering some…
Phoebe19
  • 143
  • 1
  • 1
  • 7
10
votes
0 answers

HTML2Canvas with CORS in S3 and CloudFront

I have a problem and I'm totally desperate... :( I'm using HTML2Canvas to create a screenshot of a div with many contents. I have read many similar questions: Question 1 and Question2, and I have found another one very similar to my problem: CORS…
chemitaxis
  • 13,889
  • 17
  • 74
  • 125