Reputation: 789
I read this interesting article by Microsoft. I learned that a Visio file is nothing more than a Zip file containing XML with all the information about the graph. Playing around with the code from the same article I managed to explore a Visio file, getting XML nodes for the shapes I'm interested in, for example.
My purpose is to draw the graph itself! But my primary constraint is that the application must not rely on Visio installed in the client. So I should write pure C# to render the graph, or reference some DLLs that help me to draw the graph without having Visio installed.
On the same article, at the bottom of the page, there is a link to something called pkgVisio. A VB project that can explore and display the graph. The problem with that project is 1) It's in VB! 2) It references several DLLs that I don't know and that I don't know where to get from (AxMicrosoft.Office.Interop.VisOcx, Microsoft.Office.Interop.Visio, Microsoft.Office.Interop.VisOcx, Microsoft.Practices.EnterpriseLibrary.Common, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging)
I am looking for a way to develop a program that can render a Visio file, or, if exists, a simple project that does the same thing.
Any hint or help will be really appreciated, thank you
Upvotes: 0
Views: 186
Reputation: 12235
I think if you have a real-world diagram, this task is more or less hopeless. Although Visio vsdx file is composed of XML files which are plain text, inside those XML files there are formulas. The problem is not reading XML file, the problem is building a rendering engine, which is in fact a "giant calculator", as has been noticed once by one of Visio creators. Means, as a rule, you won't actually find the coordinates of shapes to render inside those XML files, but rather the rules to calculate those coordinates.
So my recommendation would be: forget it or use the commercial package if you want to render Visio diagrams without Visio
The mentioned libraries are:
VisOcx - this is Visio drawing control, it is only installed together with Visio itself. Basically this is ActiveX wrapper control for embedding Visio into your application.
EnterpriseLibrary - This is the Microsoft Enterprise Library
Upvotes: 1