fxsvgimage
fxsvgimage copied to clipboard
The converter from JavaFX to svg jar is not included in the distrib
The converter from JavaFX to svg jar is not included in the distrib
Hi, I have a question concerning this FX to svg converter. If I understand the title correctly the converter isn't working properly as of now? I would really like to use it to convert a rather complicated tree chart node to svg and I tried your code sample on how to do it but I am getting the following errors:
java.lang.NoClassDefFoundError: org/girod/javafx/svgimage/tosvg/SVGConverter Caused by: java.lang.ClassNotFoundException: org.girod.javafx.svgimage.tosvg.SVGConverter
and the same messages for ConverterParameters.
This is roughly how I am trying to implement your converter and I do not get any errors in intelliJ but when running the program I get the above mentioned errors.
Node node = treeChart.getChart().getContent();
double contentWidth = node.getBoundsInParent().getWidth() + ADDITIONAL_WIDTH;
double contentHeight = node.getBoundsInParent().getHeight() + ADDITIONAL_HEIGHT;
// taken from example usage of the converter from https://github.com/hervegirod/fxsvgimage
ConverterParameters params = new ConverterParameters();
params.width = contentWidth;
params.height = contentHeight;
SVGConverter converter = new SVGConverter();
// Perform the conversion
File svgFile = new File("mysample.svg");
try {
converter.convert(node, svgFile, params);
System.out.println("SVG file created: " + svgFile.getAbsolutePath());
} catch (Exception e) {
e.printStackTrace();
}
Do you think I am getting these errors because of the bug you issued or am I using this wrong?
Hi, how are you setting up the classpath (manually or through maven)?
I am using maven.
This should work. Please create a reproducable example on github and I'd be happy to investigate.
I tried your code and it works fine. My guess is that you did not set up the jitpack repository in your pom e.g:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
.. you are not using the latest version:
<dependency>
<groupId>com.github.hervegirod</groupId>
<artifactId>fxsvgimage</artifactId>
<version>1.1</version>
</dependency>
Full example here: fxsvgimage_issue39
Hi, sorry for the late response and thank you very much for the example. I'll look into it and see what I did wrong in my code because I am pretty sure that I set everything up correctly in maven.