Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/311.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
C# 使用Mono+;在ubuntu上运行的单词_C#_Ubuntu_Mono_Aspose.words - Fatal编程技术网

C# 使用Mono+;在ubuntu上运行的单词

C# 使用Mono+;在ubuntu上运行的单词,c#,ubuntu,mono,aspose.words,C#,Ubuntu,Mono,Aspose.words,我正在ubuntu上使用Aspose.Words将doc/docx文件转换为pdf文件。Mono运行时已安装。我的代码如下: Document doc = new Document ("/data/upfile/test.docx"); doc.Save ("/data/upfile/test.pdf", SaveFormat.Pdf); 不知何故,当执行代码的第二行时,抛出了一个错误。详情如下: Document doc = new Document ("/data/upfile/test.

我正在ubuntu上使用Aspose.Words将doc/docx文件转换为pdf文件。Mono运行时已安装。我的代码如下:

Document doc = new Document ("/data/upfile/test.docx");
doc.Save ("/data/upfile/test.pdf", SaveFormat.Pdf);
不知何故,当执行代码的第二行时,抛出了一个错误。详情如下:

Document doc = new Document ("/data/upfile/test.docx");
doc.Save ("/data/upfile/test.pdf", SaveFormat.Pdf);
未处理的异常:System.ArgumentOutOfRangeException:startIndex+ length>this.length参数名称:长度在 System.String.Substring(Int32 startIndex,Int32长度)[0x00000]英寸 :0 at x6c95d9cf46ff5f25.x0d299f323d241756.x3b67e683e83cab62(System.String xe4115acdf4fbfccc,Int32 x961016a387451f05)[0x00000]in:0位于x4adf554d20d941a6.x50e6e6d123fa4a35.x4469479613bec4d8 (Aspose.Words.Node xda5bf54deb817e37)[0x00000]in:0位于x4adf554d20d941a6.x50e6e6d123fa4a35.x7be41bff00df2c71 (Aspose.Words.Node xda5bf54deb817e37)[0x00000]in:0位于x4adf554d20d941a6.x50e6e6d123fa4a35.x699caa1974f95d1a (Aspose.Words.Node xda5bf54deb817e37)[0x00000]in:0处x4adf554d20d941a6.x50e6e6d123fa4a35.x21e4bd206d6231f8 (System.Object xa860e35844c20ac7)[0x00000]in:0
在x4adf554d20d941a6.x50e6e6d123fa4a35.xb5ef8a04e65b87e6处 (System.String x1f25abf5fb75e795,System.Object xa860e35844c20ac7) [0x00000]英寸:0英寸 x59d6a4fc5007b7a4.xdeb77ea37ad74c56.XBF9A1EAAD81DD3A1(System.String x1f25abf5fb75e795,系统对象xa860e35844c20ac7)[0x00000]位于 :0 at x59d6a4fc5007b7a4.X487CDC969FE3D6.XBF9A1EAD81DD3A1(System.String x1f25abf5fb75e795,系统对象xa860e35844c20ac7)[0x00000]位于 :0 at x59d6a4fc5007b7a4.x487cdc969fefe3d6.XF3A1CFAFA44728C()[0x00000]英寸 :0 at x59d6a4fc5007b7a4.X487CDC969FE3D6.x47f176deff0d42e2()[0x00000]英寸 :0 at x59d6a4fc5007b7a4.x487cdc969fefe3d6.x83f07df6a659e05b()[0x00000]英寸 :0 at x59d6a4fc5007b7a4.xcde671c53995c411.xd9db07500873ae98 (Aspose.Words.Document x3664041d21d73fdc, x59d6a4fc5007b7a4.xdeb77ea37ad74c56 xdfde339da46db651)[0x00000]英寸 :0位于Aspose.Words.Document.UpdatePageLayout() [0x00000]英寸:0英寸 Aspose.Words.Document.x410db0f4a89a6ef1(布尔值x24af0daafcd8fb8c) [0x00000]英寸:0英寸 Aspose.Words.Document.get_xcde671c53995c411()[0x00000]in:0在Aspose.Words.Document.get_PageCount()[0x00000]in :0 at xf989f31a236ff98c.X6C74398BCEB13F8.xa2e0b7f7da663553 (x28925c9b27b37a46.x8556eed81191af11 x5ac1382edb7bf2c2)[0x00000]英寸 :0位于Aspose.Words.Document.xf381a641001e6830 (System.IO.Stream xcf18e5243f8d5fd3,System.String xafe2f3653ee64ebc, Aspose.Words.Saving.SaveOptions中的xc27f01f21f67608c)[0x00000] :0位于Aspose.Words.Document.Save(System.String 文件名,Aspose.Words.Saving.SaveOptions SaveOptions[0x00000]in :0位于Aspose.Words.Document.Save(System.String 文件名,SaveFormat SaveFormat)[0x00000]in:0
在中的MonoTest.MainClass.Main(System.String[]args)[0x00000]处 :0[错误]未处理的致命异常: System.ArgumentOutOfRangeException:startIndex+length>this.length 参数名称:System.String.Substring处的长度(Int32 startIndex, Int32长度)[0x00000]英寸:0英寸 x6c95d9cf46ff5f25.x0d299f323d241756.x3b67e683e83cab62(System.String xe4115acdf4fbfccc,Int32 x961016a387451f05)[0x00000]in:0位于x4adf554d20d941a6.x50e6e6d123fa4a35.x4469479613bec4d8 (Aspose.Words.Node xda5bf54deb817e37)[0x00000]in:0位于x4adf554d20d941a6.x50e6e6d123fa4a35.x7be41bff00df2c71 (Aspose.Words.Node xda5bf54deb817e37)[0x00000]in:0位于x4adf554d20d941a6.x50e6e6d123fa4a35.x699caa1974f95d1a (Aspose.Words.Node xda5bf54deb817e37)[0x00000]in:0处x4adf554d20d941a6.x50e6e6d123fa4a35.x21e4bd206d6231f8 (System.Object xa860e35844c20ac7)[0x00000]in:0
在x4adf554d20d941a6.x50e6e6d123fa4a35.xb5ef8a04e65b87e6处 (System.String x1f25abf5fb75e795,System.Object xa860e35844c20ac7) [0x00000]英寸:0英寸 x59d6a4fc5007b7a4.xdeb77ea37ad74c56.XBF9A1EAAD81DD3A1(System.String x1f25abf5fb75e795,系统对象xa860e35844c20ac7)[0x00000]位于 :0 at x59d6a4fc5007b7a4.X487CDC969FE3D6.XBF9A1EAD81DD3A1(System.String x1f25abf5fb75e795,系统对象xa860e35844c20ac7)[0x00000]位于 :0 at x59d6a4fc5007b7a4.x487cdc969fefe3d6.XF3A1CFAFA44728C()[0x00000]英寸 :0 at x59d6a4fc5007b7a4.X487CDC969FE3D6.x47f176deff0d42e2()[0x00000]英寸 :0 at x59d6a4fc5007b7a4.x487cdc969fefe3d6.x83f07df6a659e05b()[0x00000]英寸 :0 at x59d6a4fc5007b7a4.xcde671c53995c411.xd9db07500873ae98 (Aspose.Words.Document x3664041d21d73fdc, x59d6a4fc5007b7a4.xdeb77ea37ad74c56 xdfde339da46db651)[0x00000]英寸 :0位于Aspose.Words.Document.UpdatePageLayout() [0x00000]英寸:0英寸 Aspose.Words.Document.x410db0f4a89a6ef1(布尔值x24af0daafcd8fb8c) [0x00000]英寸:0英寸 Aspose.Words.Document.get_xcde671c53995c411()[0x00000]in:0在Aspose.Words.Document.get_PageCount()[0x00000]in :0 at xf989f31a236ff98c.X6C74398BCEB13F8.xa2e0b7f7da663553 (x28925c9b27b37a46.x8556eed81191af11 x5ac1382edb7bf2c2)[0x00000]英寸 :0位于Aspose.Words.Document.xf381a641001e6830 (System.IO.Stream xcf18e5243f8d5fd3,System.String xafe2f3653ee64ebc, Aspose.Words.Saving.SaveOptions中的xc27f01f21f67608c)[0x00000] :0位于Aspose.Words.Document.Save(System.String 文件名,Aspose.Words.Saving.SaveOptions SaveOptions[0x00000]in :0位于Aspose.Words.Document.Save(System.String 文件名,SaveFormat SaveFormat)[0x00000]in:0
在中的MonoTest.MainClass.Main(System.String[]args)[0x00000]处 :0


任何建议都将不胜感激。谢谢。

通过Aspose转换PDF格式的Word文档时,内部异常通常是一个非常常见的问题

这可能是由于以下原因造成的:

  • 2013 MS Word office
  • word中的一些复杂元素
  • 旧版本的Aspose.Words.dll
  • 解决方案:

  • 尝试将Aspose.Words.dll更新为新版本。如果它仍然不工作-写到aspose论坛,这个错误将在新版本中修复
  • 检查word文档本身。也许你能找到