Closed MickCoelho closed 10 years ago
What is the error that the console shows?
Absolutely nothing. I literally copied your files and try to run them from a server, but it doesn't return the image.
I tried and work fine. Try this:
html2canvas(document.body, {
"logging": true,//Enable log
"proxy":"html2canvasproxy.php",
"onrendered": function(canvas) {
var uridata = canvas.toDataURL("image/png");
window.open(uridata);
}
});
See test-case download: http://www.mediafire.com/download/52rtkcqccd1yiw5/test-case2.rar
If you still do not succeed, try accessing the link, something like:
http://site.com/location_folder/html2canvasproxy.php?url=http%3A%2F%2Fmaps.googleapis.com%2Fmaps%2Fapi%2Fstaticmap%3Fcenter%3D40.714728%2C-73.998672%26zoom%3D12%26size%3D800x600%26maptype%3Droadmap%26sensor%3Dfalse%261&callback=html2canvas_0
[update] Get errors in Firefox Console: https://developer.mozilla.org/en-US/docs/Tools/Browser_Console Get errors in Chrome Console: https://developers.google.com/chrome-developer-tools/docs/console
It works on another FTP. Seems like it's link to the Apache security. All good!
Could you be more clear about the problem?
All the files where in a password protected (using .htaccess) folder, I guess that was the reason why it wasn't working. On another FTP server it works like a charm.
[update]
I understand, as you do not have to add another. ".htaccess" inside the images folder (which is generated in the same directory html2canvasproxy.php
) for this new ".htaccess" no longer requires password on "images" folder?
In a folders structure like this:
/www/project-1/
/www/project-1/.htaccess
/www/project-1/index.php
/www/project-1/javascript/
/www/project-1/javascript/html2canvas.js
/www/project-1/apis/
/www/project-1/apis/html2canvasproxy.php
Create an folder (if no exists) in /www/project-1/apis/
with named images
, add in this folder a new file width name .htaccess
.
Add in new .htaccess
this:
Satisfy Any
The folder structure should look something like this:
/www/project-1/
/www/project-1/.htaccess
/www/project-1/index.php
/www/project-1/javascript/
/www/project-1/javascript/html2canvas.js
/www/project-1/apis/
/www/project-1/apis/html2canvasproxy.php
/www/project-1/apis/images/
/www/project-1/apis/images/.htaccess
Thank you, very helpful! Will have a deeper look into it soon.
Welcome!
Unfortunately it seems like the demo isn't working anymore.