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
6
votes
1 answer

Html2canvas Ignores object-fit for image

I've been trying to make use of html2canvas to take a screenshot of a element I noticed an image inside the div element that uses the object-fit property becomes stretched after the html2canvas screenshot Is there a walk around for this. Here is my…
precious_
  • 91
  • 4
6
votes
1 answer

Uncaught (in promise) Unable to find element in cloned iframe #2460

How can I fix this error? My code: const wrapper = document.createElement("div"); const myHTMLString = "
Hello
"; wrapper.insertAdjacentHTML("afterbegin",myHTMLString); //console.log(">>>",wrapper); html2canvas(wrapper,{useCORS:…
6
votes
3 answers

How to print full screen using jspdf and html2canvas

DEMO Hi i am using Angular8 in my application. Here i have used jspdf and html2canvas for converting html to pdf. But i am able to print only half page not the full page. Can anyone help me where i am going wrong. I have attached an demo, when i…
Bhrungarajni
  • 2,415
  • 11
  • 44
  • 88
6
votes
1 answer

html2pdf won't print hidden div after unhiding it?

I'm trying to create a PDF with html2pdf. I want html2pdf to capture a div that's hidden, and to do this, I'm attempting to briefly "un-hide" my div while the PDF is creating, then "re-hide" the div once the PDF has generated: function…
6
votes
0 answers

html2canvas is not defined

I'm developing my project using angularjs and php and need to save a certificate which will be generated at the end, Certificate with it's contents is created dynamically but cannot do right click->save as since it is not an image, So I used canvas…
Nikhilbv
  • 73
  • 2
  • 10
6
votes
5 answers

Cannot install jspdf 1.5.3

I need to convert html to pdf and I am using jspdf 1.5.2. It shows the error Cannot read property 'charAt' of undefined (using with html2canvas). When I try to install jspdf 1.5.3 I get this: npm ERR! path git npm ERR! code ENOENT npm ERR! errno…
Abdul Ahad
  • 1,221
  • 2
  • 16
  • 28
6
votes
1 answer

html2canvas captures everything except the content of an inner canvas

I've got a map rendered by means of leaflet. I need to make a screenshot of that map by using html2canvas. To make use of html2canvas, I need to provide a DOM element to capture (elementToCapture) and an optional configuration…
Andrew Tobilko
  • 48,120
  • 14
  • 91
  • 142
6
votes
2 answers

How to take a screenshot in PDF using JavaScript

I'm using Html2Canvas for capture the screenshot of my screen i want to get a output as a PDF file now i'm getting output in png image how to convert or get output in pdf function genScreenshot() { html2canvas(document.body, { onrendered:…
The Coding Bus
  • 443
  • 1
  • 6
  • 19
6
votes
1 answer

How to use addHTML in angular 4

I'm trying to use addHTML function of jspdf library in angular and have already installed html2Canvas but got an error. This is my demo.component.ts file. import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; import * as jsPDF…
Vijay Sharma
  • 342
  • 4
  • 15
6
votes
0 answers

Box-Shadow issue?

I'm trying to make the CSS box-shadow working in html2canvas. Searching in the last package (1.0.0 alpha 12) I could not find mention to boxShadow. In fact I see that it works only when I use the old version…
MROVIC
  • 71
  • 7
6
votes
3 answers

Take screenshot from external website

I am developing a startpage where users can add links to the page by using a formular. They can add name, url, description and upload an image. I want to automate the process of uploading an image, the image should be captured automatically. My…
Black
  • 18,150
  • 39
  • 158
  • 271
6
votes
3 answers

html2canvas callback Onrendered doesn't work in Angular 2

In Angular 2 project, I have installed the html2canvas module with version number 0.5.0beta. Then in my TS file, I have import it as: import html2canvas from 'html2canvas'; Then in my pdfDownload method, that I have written, html2canvas…
praveen
  • 71
  • 1
  • 4
6
votes
2 answers

Div to image with jQuery/JavaScript

I am trying to convert div to image using html2canvas library. I tried but no success can't convert full div to image, the dropper is missing in image. URL: https://www.makethatvape.com/ejuicecalc/ Tried with…
user889030
  • 4,353
  • 3
  • 48
  • 51
6
votes
2 answers

Convert HTML which contains SVG elements to image file

I'm trying to convert an html code to image file (png, jpg, whatever). However, all approach that I tried doesn't work because my HTML code has SVG elements like that:
Breno Macena
  • 449
  • 8
  • 19
6
votes
1 answer

Use html2canvas with jsPDF to save a PDF of a page

I want to create a PDF from the contents of a div. I am using jsPDF. The problem is none of my styles are passed, thus the PDF looks off. I then came across an article that uses html2canvas to take a screenshot of the page. When I try the example…
L84
  • 45,514
  • 58
  • 177
  • 257