使用Python 2.7生成* .vsd或* .vdx文件

时间:2015-11-02 09:01:38

标签: python python-2.7 visio

我正在使用Python 2.7,Ubuntu 15.我有一个数据库,其中包含一些我需要创建图表的数据。这个图表可能非常大,我无法在Firefox中打印(因为客户端已经完成),所以我想将图形导出为PDF或Visio。 PDF格式很好,但标准的Ubuntu打印程序没有“海报打印”,就像在Adobe Reader中一样,我无法安装任何其他内容。然而,Ubuntu确实拥有可以打开* .vsd的Libre Office。

我看到this信息,但这对我来说还不够。我需要更多信息,请告诉我如何在Python,示例,文档,python库或其他一些信息中创建VSD文件。

我创建了test.vdx文件并在那里编写代码(I took it here):

<?xml version='1.0' encoding='utf-8' ?>
<VisioDocument xmlns="urn:schemas-microsoft-com:office:visio">
  <Pages>
    <Page ID="0" NameU="Page-1">
      <Shapes>
        <Shape ID="3" Type="Shape" LineStyle="1" FillStyle="1" TextStyle="3">
          <XForm>
            <PinX>3</PinX>
            <PinY>9</PinY>
          </XForm>
          <Text>
            <cp IX="0"/>
            Hello World!
          </Text>
        </Shape>
      </Shapes>
    </Page>    
  </Pages>
</VisioDocument>

Libreoffice没有打开它。但它是公开的other example。我找不到原因。

0 个答案:

没有答案