Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Import SVG Files (Read 5305 times)
jgreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Aug 12th, 2010
Import SVG Files
Aug 18th, 2010 at 9:38pm
Print Post  
Any plans on adding the ability to Import SVG Files?

I tried importing a Visio 2007 vdx file and it didn't work out too well but since SVG uses better standards was hoping NetDiagram would be able to import them (since there's already an exporter for SVG).

(the client I'm evaluating this control for has about 1500 Visio 2007 documents that would need converting and doesn't want to spend weeks/months recreating them.)

Problems importing the visio file:
Shapes printed out very faint.
Text in many of the shapes came through very tiny.
Embedded images came through larger.
Links came through without arrowheads and lines were barely visible when printed.
Some shapes did not come through at all.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Import SVG Files
Reply #1 - Aug 19th, 2010 at 6:58am
Print Post  
There is already some kind of SVG import available (SvgNodes / only in ImageMap mode at this time). However SVG drawings contain only low-level graphics primitives, and the control cannot infer any higher-level structure from a drawing, such as nodes and connections.

VisioImporter supports shapes only from several Visio 2003 standard stencils. If it does not recognize some shapes from the client's files, you can handle the ShapeImported event and set the node.Shape according to the Visio shape id.

It sounds like the rest of the problems are related to an unrecognized measurement unit. You can do some post-processing to normalize pen widths and font sizes as work-around. If you send a sample vdx to support@mindfusion.eu, our developer will check what actually happens.

Stoyan
  
Back to top
 
IP Logged
 
jgreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Aug 12th, 2010
Re: Import SVG Files
Reply #2 - Aug 19th, 2010 at 2:43pm
Print Post  
I just sent the document off to support.

thanks again and if you guys ever need a testimonial, just let me know.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Import SVG Files
Reply #3 - Aug 19th, 2010 at 5:19pm
Print Post  
So far we've checked how arrowheads shapes are imported, but determining what arrowhead to set looks like a lost cause. The Visio SDK for the <EndArrow> tag says that "0" means no arrowhead and if you look through the file you will see just one <EndArrow> set to 4, everything else is 0. The non-zero one is defined in stylesheet number 11, but then this stylesheet is not used anywhere (there would be a LineStyle="11" if it was used).

So for now you will have to loop over the links after importing and set their HeadShape to Triangle to make them look as in the Visio file. For the next release we'll try to find out from where else Visio infers what arrowhead to show.

Our developer will look at the other issues tomorrow.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Import SVG Files
Reply #4 - Aug 20th, 2010 at 1:41pm
Print Post  
Quote:
Shapes and links are very thin and when printed barely show up.


It seems all line / border widths are set to 0 after importing. NetDiagram interprets that as a width of one device pixel, which is very small for printers but looks nice enough on the screen.

You will have to loop over the items after importing and set their Pen.Width to a value greater than 0 to make the links and node borders thick enough on paper. E.g. 1 worked fine in our test for the measure unit imported from the vdx.
  
Back to top
 
IP Logged
 
jgreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Aug 12th, 2010
Re: Import SVG Files
Reply #5 - Aug 20th, 2010 at 1:46pm
Print Post  
Thanks for the help.  I'll give that a shot.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Import SVG Files
Reply #6 - Aug 27th, 2010 at 4:02pm
Print Post  
This fixes some displaced links and group-within-group shapes from the file you sent us:
https://mindfusion.eu/_beta/netdiag_visio2.zip

Now that leaves only the "notes.70" shapes imported incorrectly; they are represented by a group of two connectors in Visio, which is not supported by Flowchart.NET groups. We'll try to add some special handling for them next week.

Also we've found why fonts are incorrect for some node - they inherit the font size from the shape master, which we've seen for the first time in your drawing... We'll add support for such font inheritance for the next release.

Stoyan
  
Back to top
 
IP Logged
 
jgreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Aug 12th, 2010
Re: Import SVG Files
Reply #7 - Aug 27th, 2010 at 9:24pm
Print Post  
Thanks Stoyan!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint