html2canvas

A similar solution to html2canvas with nodejs

耗尽温柔 提交于 2020-01-05 04:40:11
问题 I'm using css, jquery and nodejs (with ejs and express) to create a website and I need to export a div with some text and some divs with a background-image as an image (jpg or png) but the best would be pdf. I tried to use html2canvas but then I read that it is not compatible with nodejs. I also tried with jspdf but it doesn't export the css in the pdf file. So I would like to know if anyone knows a solution that can do that with nodejs. Here is an exemple of my ejs code : <%for(var j = 0; j

HTML2Canvas with CORS in S3 and CloudFront

喜夏-厌秋 提交于 2020-01-02 02:59:17
问题 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 policy on cached Image In Firefox, all is working fine, but in Chrome, I'm having problems with the CORS. I have this error: Image from origin 'http://files.domain.ly' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access

html2canvas Uncaught (in promise) undefined

烂漫一生 提交于 2019-12-31 07:29:08
问题 I have a html tag canvas. <canvas id="myCanvas"></canvas> I can draw on it successfully, and it looks really good, as i wanted to be. The problem is on the conversion to png.I use html2canvas for that with Canvas2Image. The html2canvas consoles logs an error: Uncaught (in promise) undefined. Canvas2Image console logs Uncaught (in promise) DOMException: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0. I can

Empty PDF report is generated when we have multiple graphs using html2canvas and jsPDF library

匆匆过客 提交于 2019-12-29 09:08:05
问题 I have two flot charts in One page , and with the code below, I want to use jsPDF to create report of them in two different pages (but one PD file) here id my code: Lets use this sample graphs : function flot1() { var oilPrices = [[1167692400000, 61.05], [1167778800000, 58.32], [1167865200000, 57.35], [1167951600000, 56.31], [1168210800000, 55.55], [1168297200000, 55.64] , [1168383600000, 54.02], [1168470000000, 51.88], [1168556400000, 52.99], [1168815600000, 52.99], [1168902000000, 51.21],

Empty PDF report is generated when we have multiple graphs using html2canvas and jsPDF library

£可爱£侵袭症+ 提交于 2019-12-29 09:08:02
问题 I have two flot charts in One page , and with the code below, I want to use jsPDF to create report of them in two different pages (but one PD file) here id my code: Lets use this sample graphs : function flot1() { var oilPrices = [[1167692400000, 61.05], [1167778800000, 58.32], [1167865200000, 57.35], [1167951600000, 56.31], [1168210800000, 55.55], [1168297200000, 55.64] , [1168383600000, 54.02], [1168470000000, 51.88], [1168556400000, 52.99], [1168815600000, 52.99], [1168902000000, 51.21],

html2canvas error: Uncaught Error: IndexSizeError: DOM Exception 1

只愿长相守 提交于 2019-12-29 07:35:12
问题 I am using html2canvas to convert a div on a canvas. Like this: <script src="js/libs/jquery-1.7.1.min.js"></script> <script src="js/libs/jquery-ui-1.8.17.custom.min.js"></script> <script src="js/html2canvas/html2canvas.js"></script> ... <body id="body"> <div id="demo"> ... </div> </body> <script> $('#demo').html2canvas({ onrendered: function( canvas ) { var img = canvas.toDataURL() window.open(img); } }); </script> and I get this error: "Uncaught Error: IndexSizeError: DOM Exception 1" in

HTML2canvas generates Blurry images

橙三吉。 提交于 2019-12-28 03:54:08
问题 I am using jsPDF and it uses html2canvas to generate an image from some html element and insert on the .pdf file. But there is a problem on html2canvas, it generates blurry images from the html. See example below: HTML content: http://puu.sh/7SZz4.png html2canvas generated image: http://puu.sh/7SZAT.png Is there any way to fix it or is there any better option to get the image form html? thanks! 回答1: you can use scale options in html2canvas. In the latest release, v1.0.0-alpha.1, you can use

html2canvas does not take css style from external css file

安稳与你 提交于 2019-12-25 08:56:41
问题 I am converting div contains svg objects, images and html contents to image using html2canvas, But it does not taking the css style from external css file. i have put those css classes target and circle in external css file. Somebody please help me on this.. i have attached both images what i am seeing in browser and the exported image Thanks in advance. here is my code sample: window.exportAsImage = function () { var target = document.getElementById("target"); html2canvas(target, {

html2canvas border image issue

ε祈祈猫儿з 提交于 2019-12-24 20:11:36
问题 I am using html2canvas library to take screenshot of html view. but background-image failed to load. i am getting error message Error loading background: here is my JSFiddle. window.takeScreenShot = function() { html2canvas(document.getElementById("target"), { onrendered: function (canvas) { document.body.appendChild(canvas); }, useCORS:true, logging:true, allowTaint:true }); } #target{ width:300px; height:160px; background:lightblue; color:#fff; padding:10px; background-image: url(https:/

leaflet+canvg+html2canvas = MyImage.png

给你一囗甜甜゛ 提交于 2019-12-24 16:39:50
问题 Good day my dear friends. I want to create png file from lealfet map. I use html2canvas library, and leaflet map tiles and other elemets converts to png greatfully, but not svg-elements(offsets). I know, that there is some code to redraw all svg elements to canvas( var canvas = L.canvas(); var map = new L.Map('map', {layers: [osm], preferCanvas: true}); but this is bad way for me, because, when I change extend all svg element flickers... So...How can I using CANVG convert leaflet svg polygons