Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Phantomjs support CSS3 Columns for HTML to PDF conversion?

Tags:

css

phantomjs

I'm trying to convert a html page to PDF. The conversion works fine with PhantomJS, however, phantomjs does not seem to support CSS3 columns.

The command I'm running (html->pdf)

phantomjs.exe examples/rasterize.js http://davidwalsh.name/demo/css-columns.php sample.pdf

The resulting PDF does not honour the CSS columns style, displaying a vertical list of items instead.

However, running the following command to convert html->image does honour the CSS3 Columns style:

phantomjs.exe examples/rasterize.js http://davidwalsh.name/demo/css-columns.php sample.png

Can someone please confirm that this is expected behaviour?

BTW, I've tried using wkhtmltopdf but this does/will not be supporting CSS Columns.

Many Thanks

like image 930
singh1469 Avatar asked Oct 09 '13 15:10

singh1469


1 Answers

I believe that the webkit version on which PhantomJs relies probably is not implementing CSS3 columns, although the major webkit browsers (Safari and Chrome) both do. This link

https://github.com/ariya/phantomjs/wiki/Supported-Web-Standards

and this link

http://trac.webkit.org/wiki/QtWebKitFeatures22

will shed as much as light as there is on this topic, AFAIK.

like image 71
stolli Avatar answered Sep 28 '22 10:09

stolli