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
10
votes
2 answers

html2canvas, styles not applied to canvas?

I'm working on a script for manipulating pictures and saving it to an image. I have a div where i set a background image and in that div i have another div with an image which i manipulate (resize,rotate and drag around). Everything is working fine,…
gregaj
  • 328
  • 1
  • 6
  • 15
10
votes
1 answer

Can html2canvas render svg in a page?

I am using html2canvas to create a 'screenshot' of a HTML page that contains SVG. Everything looks good, except the element. I know that it should be possible to render SVG in Canvas; PhantomJS, fabric.js and CanVG do it. Is this something that…
rakensi
  • 1,437
  • 1
  • 15
  • 20
9
votes
2 answers

How to fit an image in the center of a page using jsPDF?

Using html2canvas & jsPDF, I'm trying to print an entire DIV I have on my screen and I've gotten this far: const printAsPdf = () => { html2canvas(pageElement.current, { useCORS: true, allowTaint: true, scrollY: -window.scrollY, …
Amruth Pillai
  • 1,539
  • 2
  • 13
  • 28
9
votes
3 answers

html2canvas in angular 4

I am able to take a screenshot using html2canvas in angular 4 but i need to send the string image to the server side using a http post call Component import { Component, OnInit, NgZone } from '@angular/core'; import { Router, ActivatedRoute,…
Pein
  • 423
  • 3
  • 11
  • 27
9
votes
3 answers

Chartjs + jsPDF = Blurry image

I'm having some issues exporting my Charts to PDF. I have this div
'.$_SESSION['team_name'].''; ?> …
Tiago São José
  • 292
  • 3
  • 5
  • 12
9
votes
3 answers

how to capture screenshot in html using js or jquery

I'm need my clients be able to capture screenshot of any page of my website using button like this: I tried to use html2canvas but it's doesn't work properly for me because i have iframe's in my website and it's…
divelner
  • 244
  • 1
  • 2
  • 10
9
votes
1 answer

Is there any way to convert c3.js generated graph to png, and Png to Pdf in client side

I want to generate a PDF file on the client side with a graph and other tabular data coming from a JSON object. The following is the Javascript data binding part: BindReportToPdf: function (data) { //data is json object var rows = data; …
sanjeev bhusal
  • 245
  • 1
  • 14
9
votes
2 answers

Prevent some elements from being rendered canvas

This is my website. I want the background of my nav-element to be blurred... I used html2canvas and stackblur for this, and you can find the tutorial here. My problem is now that I want to exclude the nav-element from being rendered in canvas, so it…
Geatrix
  • 113
  • 1
  • 1
  • 7
9
votes
3 answers

html2canvas - no screenshot for iframe

I have a task where i need to load a URL (e.g www.yahoo.com) , on my webpage, and take screenshot. I am using html2canvas for screenshot and appending it to the body of the page. The page specified by the URL is successfully loaded in an iframe…
roger_that
  • 9,493
  • 18
  • 66
  • 102
9
votes
10 answers

Arabic Encoding with html2canvas

I am using html2canvas to take an image of a div, the content is from the same page, same domain, but it shows the Arabic letters disconnected, it seems that html2canvas doesn't support Arabic. While I am reading the available details about it on…
mfadel
  • 887
  • 12
  • 32
9
votes
4 answers

html2canvas error: Uncaught Error: IndexSizeError: DOM Exception 1

I am using html2canvas to convert a div on a canvas. Like this: ...
ErisoHV
  • 367
  • 1
  • 6
  • 15
8
votes
5 answers

Is it possible to to take a screenshot of an iframe in a web page?

I'm trying to take a screenshot of an iframe in a webpage. In my particular case, the iframe contains the Street View of one of my clients' store. As far as I've searched and read, I didn't find any solution to this. I know there are JavaScript…
eccebombo
  • 81
  • 1
  • 1
  • 5
8
votes
2 answers

generating pdf from Html in React using html2canvas and jspdf

I have successfully generated the pdf from html2canvas and jspdf in React. But the problem is the image rendered in the pdf is stretched. Please let me know what the best option to do this kind of work is. Is there any possibility of rendering the…
Mohamed Mubarak
  • 113
  • 2
  • 2
  • 6
8
votes
1 answer

how to hide the divs in html2canvas

Hello all i am using jsPDF along with html2canvas. I have seen in the add.HTML that you can hide some divs. Is it possible to have this ability in html2canvas. I am actually making a pdf but i want some divs of the main div to not to be printed in…
tech_geek
  • 1,624
  • 3
  • 21
  • 44
8
votes
3 answers

Converting a div with attribute "hidden" to pdf with jsPDF and html2canvas

I'm using jsPDF and html2canvas to convert a div to pdf: PDF
Some content here
However I don't want my div displayed on the screen. I tried using hidden property to hide the div:
Nicholas Kajoh
  • 1,451
  • 3
  • 19
  • 28