Highcharts using svg image to create pdf
来源:互联网 发布:大数据应用的软件 编辑:程序博客网 时间:2024/05/19 16:35
来自:http://code.google.com/p/phantomjs/issues/detail?id=364
Version PhantomJS 1.3.0What steps will reproduce the problem?1. run phantomjs rasterize.js http://localhost/high_test_svg.html phantomjs_test_svg_png.pdf2. I have attached a test html file with source images and output.What is the expected output? chart with no grayed out linesWhat do you see instead?graph lines are being grayed outWhich operating system are you using?Linux version 2.6.18-238.19.1.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50))Did you use binary PhantomJS or did you compile it from source?Compile from sourcePlease provide any additional information below.
Jan 28, 2012
Thanks for taking a look at this, the patch will do the trick. While, researching this issue further, I also thought that tracking might becausing some of the difficulties, so in trying to isolate and simplify there-creation of the issue, I created an additional svg file, with all theanimations, tracking, and tooltips turned off, etc and it looks good. I also wrote a simple PyQt script that exports to pdf using the QWebViewand QPrinter functions to try to isolate the issue may be. I have attachedboth files. Love phontom. Thanks. Thanks.
Jul 5, 2012
Just a note, I wouldn't be surprised if this is due to how certain CSS styles get overridden while printing (I've noticed that opacity gets set to 1.0 in other contexts).
Jan 24, 2013
This fix is one way to do it. It disables the shadows though. Another way would be to disable mousetracking in the options. The only problem I'm left with now is the shadow opacity. Any ideas?Here's an example http://jsfiddle.net/jvisser/aKJLv/And use this command to rasterize:phantomjs examples/rasterize.js http://fiddle.jshell.net/jvisser/aKJLv/show/light/ output.pdf A4
Mar 15, 2013
Closing. This issue has been moved to GitHub: https://github.com/ariya/phantomjs/issues/10364
//
//
generate_pdf(保持页面原始大小).js
// This file is NOT a browser-run javascript but PhantonJS scriptvar system = require('system');var address = system.args[1];var output = system.args[2];var page = require('webpage').create();page.paperSize = { format: 'A4', orientation: 'landscape', border: '1cm'};page.open(address, function (status) { if (status !== 'success') { console.log('Unable to load the address!'); phantom.exit(); } else { window.setTimeout(function () { // Remove all low-opacity paths. see PhantomJS issue #364 page.evaluate(function () { var paths = document.getElementsByTagName("path"); for (var i = paths.length - 1; i >= 0; i--) { var path = paths[i]; var strokeOpacity = path.getAttribute('stroke-opacity'); if (strokeOpacity != null && strokeOpacity < 0.2) path.parentNode.removeChild(path); } }); page.render(output); phantom.exit(); }, 5000); }});
///
///
generate_pdf(rasterize的重写).jsgenerate_pdf(rasterize的重写).js
var page = require('webpage').create(), system = require('system'), address, output, size;if (system.args.length < 3 || system.args.length > 5) { console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]'); console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"'); phantom.exit(1);} else { address = system.args[1]; output = system.args[2]; page.viewportSize = { width: 1024, height: 768 }; if (system.args.length > 3 && system.args[2].substr(-4) === ".pdf") { size = system.args[3].split('*'); page.paperSize = size.length === 2 ? { width: size[0], height: size[1], margin: '0px' } : { format: system.args[3], orientation: 'portrait', margin: '1cm' }; } if (system.args.length > 4) { page.zoomFactor = system.args[4]; } page.open(address, function (status) { if (status !== 'success') { console.log('Unable to load the address!'); phantom.exit(); } else { window.setTimeout(function () { // Remove all low-opacity paths. see PhantomJS issue #364 page.evaluate(function () { var paths = document.getElementsByTagName("path"); for (var i = paths.length - 1; i >= 0; i--) { var path = paths[i]; var strokeOpacity = path.getAttribute('stroke-opacity'); if (strokeOpacity != null && strokeOpacity < 0.2) path.parentNode.removeChild(path); } }); page.render(output); phantom.exit(); }, 5000); } });}
- Highcharts using svg image to create pdf
- C# PDF to image
- Pdf to Image
- Convert pdf to image
- How to create jigsaw puzzle from an image using javascript(拼图引擎)
- Using visual C++ to create a simple image and masker tool kit
- Using two WebServices exposed by SSRS to create PDF report formats programmatically
- How to create recovery image
- failed to create framebuffer image
- PDF to Image Converter-convert pdf to image
- ionic2 svg格式icon不显示,报错: Refused to load the image 'data:image/svg
- how to create images using gdal
- how to create images using gdal
- How to create a PDF file, cheaply?
- Create Barcode in ABAP : conversion to PDF
- How to create a Symbian application icon (SVG)
- css---Using Background-Image to Replace Text
- Image to PDF Converter in Salesforce
- java中比较字符串相似度
- Oracle创建dblink报错:ORA-01017、ORA-02063解决
- schema验证xml
- 关于web.xml的首页和struts的action的问题
- android 图形图像编程- 第三章 路径(Path)和剪切(Clipping)
- Highcharts using svg image to create pdf
- 扩展方法,对象初始化器,集合初始化器的运用
- seo
- Linux进程的睡眠和唤醒
- MySQL的BLOB类型存储大小调整
- php接收来自命令行输入的参数
- C++ 标准模板库STL 队列 queue 使用方法与应用介绍(一)
- java String 的trim 方法,并不仅仅是去掉空格
- 让Thinkpad USB键盘支持小红帽中键滚轮的方法(ThinkPad USB Keyboard with TrackPoint)
190 KB Download