niklasvh / html2canvas

Screenshots with JavaScript
https://html2canvas.hertzen.com/
MIT License
30.61k stars 4.81k forks source link

html2canvas some how stop rendering image #976

Closed raaaas closed 6 years ago

raaaas commented 8 years ago

hello everyone,

ive installed/added html2canvas to my project and after few working around everything was okay but right after my boss start testing it my project for no reason stop rendering imgs

here is example : index it was befor my boss testing

and here is after my boss tested canvas

my code : ` $('#cmd').click(function () { var width = doc.internal.pageSize.width;
var height = doc.internal.pageSize.height var screenshot = '';

    html2canvas($(".warpper")).then(function(canvas) {
        document.body.appendChild(canvas);
    });

    /*,{
            "logging": true,allowTaint: true,
        onrendered: function(canvas) {
            //doc.addImage(canvas, 'png', 0, 0, width, height,undefined,'slow');
            //doc.save('vito.pdf');
            document.body.appendChild(canvas);

            }
             });
             */

});`

note : im useing latest version : v0.5zip im useing it with laravel - backpack

ps : if anyone could give me help on fixing unicode bug that would be awesome too.

raaaas commented 8 years ago

first bug was because of in div which had img inside it so i moved it out side and fixed

then in chroom i had bug which only html2canvas render 1 image even if in log shows it found 2 img etc ok wiredly enough problem cused by jspf

i just change order of jspdf to be loaded befor html2canvas and it fixed

fot charecter bug i just did this

line 2321 : var textList = (!this.options.letterRendering || noLetterSpacing(container)) && !hasUnicode(container.node.data) ? getWords(characters) : characters.map(function(character) {

just changed it to var textList = (!this.options.letterRendering || noLetterSpacing(container)) && hasUnicode(container.node.data) ? getWords(characters) : characters.map(function(character) {

everything work just fine right now

BilalAdhi commented 6 years ago

In Which file i have to change the following Code?

line 2321 : var textList = (!this.options.letterRendering || noLetterSpacing(container)) && !hasUnicode(container.node.data) ? getWords(characters) : characters.map(function(character) {

just changed it to var textList = (!this.options.letterRendering || noLetterSpacing(container)) && hasUnicode(container.node.data) ? getWords(characters) : characters.map(function(character) {