Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/155.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将ms word文档转换为C#或C+中的svg+;_C#_C++_Visual C++_Svg_Ms Word - Fatal编程技术网

将ms word文档转换为C#或C+中的svg+;

将ms word文档转换为C#或C+中的svg+;,c#,c++,visual-c++,svg,ms-word,C#,C++,Visual C++,Svg,Ms Word,我想在web浏览器中查看MS Word文档。所以我需要把它转换成svg格式。 如何用C语言或C++语言将MSWord文档转换成SVG格式?哪些开源库可以支持这个? < P>有一个库Dox可以帮助。 然后,您可以读取docx文件并编写自己的转换器 或者,您可以使用Microsoft的Office interop库,将docx转换为.pdf或.html等格式。之后将其转换为.svg会更容易。 代码可以在上找到。我使用Print2Flash库直接从我的ASP.NET网站上的Word文档中获取SVG文件

我想在web浏览器中查看MS Word文档。所以我需要把它转换成svg格式。
如何用C语言或C++语言将MSWord文档转换成SVG格式?哪些开源库可以支持这个?

< P>有一个库Dox可以帮助。 然后,您可以读取docx文件并编写自己的转换器

或者,您可以使用Microsoft的Office interop库,将docx转换为.pdf或.html等格式。之后将其转换为.svg会更容易。
代码可以在

上找到。我使用Print2Flash库直接从我的ASP.NET网站上的Word文档中获取SVG文件。我相信C++也得到了支持。您需要:

  • 在服务器上下载并安装Print2Flash
  • 下载Primt2Flash SDK并从ASP.NET中抽取C++和C++样本
    然后,您只需要按照示例使用说明进行操作。这两个文件都可以从这个下载页面获得:

    Aspose为两者提供了一个库,用于将Word文档转换为SVG

    • 在C中执行转换的代码段#

    • 在C中执行转换的代码段++

      // The path to the documents directories.
      System::String inputDataDir = GetInputDataDir_LoadingAndSaving();
      System::String outputDataDir = GetOutputDataDir_LoadingAndSaving();
      
      // Load the document from disk.
      System::SharedPtr<Document> doc = System::MakeObject<Document>(inputDataDir + u"Document.doc");
      System::String outputPath = outputDataDir + u"ConvertDocumentToSVG.svg";
      
      // Save the document as SVG.");
      doc->Save(outputPath);
      
      //文档目录的路径。
      System::String inputDataDir=GetInputDataDir_加载和保存();
      System::String outputDataDir=GetOutputDataDir_加载和保存();
      //从磁盘加载文档。
      System::SharedPtr doc=System::MakeObject(inputDataDir+u“Document.doc”);
      System::String outputPath=outputDataDir+u“ConvertDocumentToSVG.svg”;
      //将文档另存为SVG。“);
      单据->保存(outputPath);
      
    有关详细信息,请查看文档:

    // The path to the documents directories.
    System::String inputDataDir = GetInputDataDir_LoadingAndSaving();
    System::String outputDataDir = GetOutputDataDir_LoadingAndSaving();
    
    // Load the document from disk.
    System::SharedPtr<Document> doc = System::MakeObject<Document>(inputDataDir + u"Document.doc");
    System::String outputPath = outputDataDir + u"ConvertDocumentToSVG.svg";
    
    // Save the document as SVG.");
    doc->Save(outputPath);