Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SvgExporter.export throws exception (Read 2387 times)
Sudha Ravikumar
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 1
Joined: Mar 3rd, 2015
SvgExporter.export throws exception
Mar 3rd, 2015 at 9:44pm
Print Post  
I'm trying to use SvgExporter to export a diagram. My code looks like
Code (Java)
Select All
String path ="C:/test.svg";
        SvgExporter svgExporter = new SvgExporter(diagram, path);
        svgExporter.export();
 



svgExporter throws

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
     at java.lang.String.substring(String.java:1954)
     at com.mindfusion.svg.Tools.ExtractPathName(Unknown Source)
     at com.mindfusion.svg.SvgDocument.<init>(Unknown Source)
     at com.mindfusion.svg.SvgGraphics2D.<init>(Unknown Source)
     at com.mindfusion.diagramming.export.SvgExporter.export(Unknown Source)
     at com.ierin.paragon2.client.reports.AbstractTreeReport.getImageFromDiagram(Abstrac
tTreeReport.java:254)


Any idea what is missing?

Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SvgExporter.export throws exception
Reply #1 - Mar 4th, 2015 at 8:15am
Print Post  
SvgExporter splits the specified path by File.separator symbol, which is a \ on Windows, so you should use "C:\\test.svg" instead. However writing to root C:\ folder will not work on newer Windows version due to security restrictions, unless you have explicitly assigned write access for it to your user account, so try with C:\\temp\\ instead, or somewhere inside your documents folder.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint