SVG generator fails on linux

I’m trying to print out multiple charts via PDF. As I’ve followed the guide from the the book of Vaadin I’ve had no problem doing this in my testenviroment (a localhost glassfish-server), but when I run it on the pre-deploy server, which runs linux, then the graphs get all weird.

At first I though it was some margins or scales, but I just confirmed by reading an SVG file in from disk, that the iText and batik features works fine. Hence the problem lies within the SVG generator.

I’ve had the following post on stackoverflow since friday: http://stackoverflow.com/questions/37749166/itext-batik-and-vaadin-charts-scales-wrong-on-linux, which contains the code.

I really hope somebody here can help me :slight_smile:

Ben


Update
I’m using phantomJS version 2.1.1 in both enviroments.


Workaround
seems to be using an older version og PhantomJS. It’s working with 1.9.8. Created a ticket with Vaadin.

FWIW I’m using PhantomJS 2.1.1 (compiled from source) on CentOS 7 to good effect with Vaadin 7.6.4 and Charts 3.0.0.

Your test case on SO has some additional components that might be at issue (turning it into PDF, rescaling the SVG, etc.), have you tried saving the SVG directly with no further transformation?

Also note that SVGGenerator is not threadsafe and requires external synchronization… I really don’t like the non-threadsafe singleton thing going on there.