Questions tagged [dom-to-image]

Use this tag for questions relating to issues using the dom-to-image JavaScript (https://www.npmjs.com/package/dom-to-image) library. DO NOT use this tag for reporting bugs in the library, instead raise an issue to the open-source repository: https://github.com/tsayen/dom-to-image/issues.

40 questions
0
votes
0 answers

How to download a QR code generated using react-qrcode-logo with an image from Firebase?

I am using the react-qrcode-logo library in my React project to generate a QR code. The QR code includes an image that is stored in Firebase. Here is my code: import { QRCode } from "react-qrcode-logo";
0
votes
1 answer

leaflet with mapkitmutant and apple mapkit domToImage generates an all-grey image

leaflet with mapkitmutant and apple mapkit domToImage generates an all-grey image This works as expected with openstreet, google maps and bing maps. The onscreen display is okay, just the domToImage output is all grey. To add the map to leaflet: }…
0
votes
0 answers

dom-to-image background image not showing up on mobile

i'm trying to capture an entire div which has some text over a background image that covers said div entirely. It works fine on desktop but on mobile, when i try to download it the background image doesn't show up at all instead the text is on a…
queercoded
  • 55
  • 9
0
votes
0 answers

How to create a Pdf In Angular with Hebrew characters

Is there a way to create a PDF directly from HTML that includes Hebrew? I'm trying to export a PDF with Hebrew characters, The only way that worked for me is with dom-to-image, but that creates a very large file.
BeJo
  • 11
  • 3
0
votes
0 answers

react, domtoimage not working when used on different components

So, I am using react to create an image generator. With different components (header, sidebar and bannercontent). In the header I have a button which, when clicked, should generates an image that is located in the bannercontent, which holds a canvas…
udarts
  • 745
  • 1
  • 8
  • 23
0
votes
0 answers

How to get image of map drawn using leaflet and ordinance survey vector tile api in angular?

I have a map drawn using leaflet v1.8.0. The map is taken from ordinance survey map and is drawn using ordinance vector tile API. It includes drawings (polygons, circles etc) as well as markers. I need to get an image of the map to put inside a pdf.…
Galaxy6789
  • 36
  • 5
0
votes
1 answer

Ways to capture r shiny Handsontable in a jspdf printout without corruption

I've been working of a reporting feature for an app. It has several small tables that I have been copying over with dom-to-image in jsPDF. var image = new Image(); var node; node = document.getElementById("Table1"); await…
0
votes
1 answer

click to direct download with javascript

I tried the dom-to-image library to download a set of HTML div. The "to-image" part worked just fine, but after the div was converted to an image, I want it also downloaded directly as an image. But I can't do that. The dom-to-image docs said you…
louislugas
  • 147
  • 6
0
votes
0 answers

Why additional space is appears in right side of pdf?

I am using dom-to-image and jsPDF to generate a A5 PDF. Additional space appears on every page of the pdf, but the canvasImageWidth and pdfWidth are same, by right the content should fit the pdf width exactly. How to remove those spaces? const…
Jiawen
  • 1
  • 1
0
votes
1 answer

Async await function not ending in the order that it should Javascript

Why is the function convertToPng that I have stated to await for until completion, specifically until the imgOnLoad is entered and the PDF is created, is still being executed simultaneously? Actual Results "Convert to png function has…
Yeo Bryan
  • 331
  • 4
  • 24
0
votes
0 answers

How to get the screenshot of SVG on Safari?

I used dom-to-image to get the screenshot of svg, it worked successful on Chrome, but it will lost some svg layers on Safari. Is there any way to get screenshot of svg on Safari?
wow
  • 11
  • 1
0
votes
1 answer

How to render "intrinsic" size of element with Dom-To-Image

I'm using tsayen's dom-to-image library to snapshot an image element. The intrinsic size of my image is close to 1000x1000px, but on my website I have it scaled down to about 500x500px. I'm wanting to scale the image back to its intrinsic size…
user11855540
0
votes
1 answer

Using dom-to-image in an ionic react app (typescript) - "Uncaught TypeError: Cannot read properties of undefined (reading 'toPng')"

I receive the error in the title when calling the following function in my app. let container = this.myRef.current!; DomToImage.toPng(container) .then(function (dataUrl) { var img = new Image(); img.src = dataUrl; …
0
votes
1 answer

React dom-to-image error when there is an external image link in the dom

I wanted to save a dom as an image, I used dom-to-image it works when there is no external image link in the dom dom-to-image This Works It saved the image But when i add an image tag with an external link to it It throws an error
Alohe
  • 301
  • 2
  • 11
0
votes
0 answers

Download a section of a webpage as an image with same design for desktop and mobile

I am using dom-to-image library so whenever a user click on a button I want to download that section as an image. It is working fine on desktop. But, in mobile the image is downloading like a responsive mobile design. On mobile view it should…
Danish Shaikh
  • 474
  • 3
  • 14