wkhtmltopdf failure when embed an SVG

前端 未结 4 537
-上瘾入骨i
-上瘾入骨i 2020-12-17 14:27

Has anyone in this vast space has ever had the luck to successfully create a PDF with an embedded SVG on an HTML? I\'ve been receiving segmentation fault all the time.

4条回答
  •  我在风中等你
    2020-12-17 14:52

    If this fix doesn't work for others, here's what worked for me with chartist.js, and wkhtmltopdf 0.12.2.1 under Ubuntu 64. (Credit to Panokev)

    Add this to your javascript before all other JS.

    {
    
    Function.prototype.bind = Function.prototype.bind || function (thisp) {
        var fn = this;
        return function () {
            return fn.apply(thisp, arguments);
        };
    };
    

    Definitively set width style for chart div, for example - style="width:950px;"

提交回复
热议问题