niklasvh / html2canvas-proxy-nodejs Goto Github PK
View Code? Open in Web Editor NEWExpress middleware proxy for html2canvas
Home Page: https://html2canvas.hertzen.com/
Express middleware proxy for html2canvas
Home Page: https://html2canvas.hertzen.com/
Is there any way to use this proxy with MeteorJS?
I set up a node/express project on heroku and made modifications to app.js following the instructions on the front page like so:
var proxy = require('html2canvas-proxy');
var express = require('express');
var app = express();
var port = (process.env.PORT || 3000);
app.use("/", proxy());
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
app.listen(port);
I put the url into the 'proxy' property of html2canvas like so. (The actual domain has been changed to protect the proxy.)
proxy: 'https://proxy.domain.com',
height: $('.react-grid-layout').height(),
width: $('.react-grid-layout').width(),
background: '#FFFFFF',
allowTaint: false
I continue to get this error when trying to export canvases that refer to external image urls:
Image from origin 'https://proxy.domain.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://trays-staging.herokuapp.com' is therefore not allowed access. The response had HTTP status code 503.
https://proxy.domain.com/?url=http%3A%2F%2F7-themes.com%2Fdata_images%2Fuserpics%2Fu_18.gif Failed to load resource: the server responded with a status of 503 (Service Unavailable)
Image from origin 'https://proxy.domain.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://trays-staging.herokuapp.com' is therefore not allowed access. The response had HTTP status code 503.
https://proxy.domain.com/?url=http%3A%2F%2F7-themes.com%2Fdata_images%2Fout%2F41%2F6909460-colorful-spirals.jpg Failed to load resource: the server responded with a status of 503 (Service Unavailable)
Hi @niklasvh, do you know if this lib works with Vue?
Thanks in advance.
canvas.todataurl displaying blank image in IE but working in Chrome and Firefox
<script> $('#h2c').click(function () { html2canvas(document.querySelector("#plotly_div")).then(function (canvas) { var imgageData = canvas.toDataURL("image/png", 1.0); document.getElementById("jpg-export").src = imgageData; }); }); </script>Im unable to use it. Please give some example so that its easy to use html2canvas. Give a brief description of each usage.
Thanks in advance
No url specified" error , i faced this error and I'm sure that my implementation is so street
We could run this, but I'm not sure we should be using the request and response object or not? Thanks for any pointers!
exports.helloWorld = functions.https.onRequest((request, response) => {
// response.send("Hello from Firebase!");
app.use('/', proxy());
});
Hi, I'm using 0.5.0-beta3 for SVG support. I was previously using the PHP proxy but switched to this node implementation and it appears that rather than html2canvas extracting the base64-encoded image from the response it's expecting a URL to the cached image.
Is this proxy implementation compatible with 0.5.0-beta3 and if so how do I configure html2canvas to work with it?
I am using the proxy like that in the code. In local setting, it works fine but when I deploy to prod, this error gets thrown. Does anyone know why this is happening or know what the error means?
Another thing I want to mention is that then that line is moved to the very bottom, no error gets thrown but it doesn't seem to work anymore since images become blank in screenshots.
how use html2canvas-proxy-nodejs in koa project.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.