PhantomJS不会渲染SVG的可见溢出

时间:2017-02-25 16:48:06

标签: svg phantomjs overflow casperjs capture

我使用CasperJS和PhantomJS 2.1.1捕获我的SVG元素,但是PhantomJS没有渲染设置为overflow: visible的SVG溢出。我想知道是否有任何我应该为此目的启用的设置?

这是我的页面:

enter image description here

这是拍摄的图像:

enter image description here

这是我的CasperJS代码:

var casper = require('casper').create({
    viewportSize: {
        width: 1000,
        height: 400
    }
});

var url = 'http://localhost:4000/embed?' + casper.cli.options.url;

casper.start(url, function() {
    casper.waitForResource(function testResource(resource) {
        return resource.url.indexOf("/charts") != -1;
    }, function onReceived() {
        this.wait(4000, function(){
            this.evaluate(function(){
                $('.fa-camera, .fa-code, .fa-question-circle').remove();

                $('body').append('<span style="z-index:99999;position:absolute;bottom:30px;left:35px;">' + moment().format('MMM DD, YYYY') + '</span>');
            });

            this.echo(this.captureBase64('png'));
            this.exit(0);
        });
    });
});

casper.run();

0 个答案:

没有答案