Open Osiris-Team opened 2 months ago
Simple example to show this issue:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>DOM to PDF Shadow Root Example</title> </head> <body> <div id="container"></div> <script src="https://unpkg.com/dom-to-image@2.6.0/src/dom-to-image.js"></script> <script> document.addEventListener('DOMContentLoaded', function () { var container = document.getElementById('container'); var root = container.attachShadow({ mode: 'open' }); root.textContent = 'Hello World!'; domtoimage.toPng(container) .then(function (dataUrl) { var img = new Image(); img.src = dataUrl; document.body.appendChild(img); }) .catch(function (error) { console.error('Oops, something went wrong!', error); }); }); </script> </body> </html>
The issue is that dom-to-image creates a blank image instead containing the text.
你好,我已收到你的来信。辛苦了!!
Simple example to show this issue:
The issue is that dom-to-image creates a blank image instead containing the text.