以编程方式操作 visio 格式文件
我想从 Visio 文件中提取信息并对它们进行一些更改(例如使用 C++),然后将它们写回?
我的问题是:
是否可以通过编程操作visio文件(主要是读取和写入)?
如果是这样,任何教程林都是首选
I want to extract information from a Visio file and do some change on them(like using C++), then write them back?
My question is:
Is manipulating visio files(mainly reading and writing) programmingly possible?
If so, any tutorial lin is preferred
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
读取/写入 Visio VSD 文件
这是一种二进制格式,据我所知,它没有记录。不过,请查看 LibreOffice 中对读取 Visio VSD 文件的支持的进展情况。
读取/写入 Visio VDX 文件
这些只是 VSD 文件的 XML 等效项,如果您熟悉 Visio,那么读写起来相对简单。对于简单的任务,例如查找和操作所有形状自定义属性或格式化,将 XML 加载到 DOM 中、对其进行处理,然后将其保存回来将非常简单。例如,我曾经编写过一个小工具,使用这种技术来搜索和替换一组 VDX 文件中的文本。一个警告:您想要执行的任务越复杂,您就越需要非常熟悉 Visio 以及它如何与 Shapesheets 等配合使用。
以下是一个入门链接:http://msdn.microsoft.com/en-us/library/aa218409(v=office.10).aspx
Reading/Writing Visio VSD Files
This is a binary format and as far as I know, it is not documented. However, check out what has been going with support for reading Visio VSD files in LibreOffice.
Reading/Writing Visio VDX files
These are just the XML equivalent of VSD files and relatively straightforward to read and write if you are familiar with Visio. For simple tasks such as finding and manipulating all shape custom properties or formatting it will be very straightforward to load the XML into a DOM, process it, and then save it back out. For example, I once wrote a small tool that used this technique to search and replace text in a set of VDX files. One warning: the more complex a task you want to perform, the more you will need to be very familiar with Visio and how it works with Shapesheets, etc.
Here's a link to get started: http://msdn.microsoft.com/en-us/library/aa218409(v=office.10).aspx