问题标签 [aspose.words]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1763 浏览

.net - Aspose Words Document 不加载我的 FormFields

我现在在创建文档时遇到问题。我创建了一个包含多个 MergeField 元素的 Word docx 文档。我的文档内容保存到我的数据库中,稍后我使用 MemoryStream myStream = new MemoryStream(byte[]); 在我的代码中的其他地方检索它 文档 doc = new Document(myStream);

当我尝试使用 doc.Range.FormFields 访问我的表单合并字段时,列表为空。我想知道为什么,因为当我执行 doc.Range.GetText(); 时我仍然可以看到 MergeField 元素的格式。

你能帮我解决这个问题吗?我已经挣扎了一段时间。在我访问其 Range 的文本后,请参阅下面的文档内容。我还附上了我的内容的屏幕截图,我们可以在其中看到我的 MERGE FIELD 元素的标签。

原始内容:

0 投票
1 回答
530 浏览

c# - 使用在 ubuntu 上运行的 Mono+Aspose.Words 时引发异常

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

不知何故,当执行第二行代码时,抛出了一个错误。详情如下:

未处理的异常:System.ArgumentOutOfRangeException:startIndex + length > this.length 参数名称:System.String.Substring 的长度(Int32 startIndex,Int32 长度)[0x00000] in :0 at x6c95d9cf46ff5f25.x0d299f323d241756.x3b67e683e83cab62 (System.String xe4115acdf4, x961016a387451f05)[0x00000]中:0在x4adf554d20d941a6.x50e6e6d123fa4a35.x4469479613bec4d8(Aspose.Words.Node xda5bf54deb817e37)[0x00000]中:0在x4adf554d20d941a6.x50e6e6d123fa4a35.x7be41bff00df2c71(Aspose.Words.Node xda5bf54deb817e37)[0x00000]中:0在x4adf554d20d941a6 .x50e6e6d123fa4a35.x699caa1974f95d1a(aspose.words.node xda5bf54deb817e37):0:0在x4adf554d20d941a6.x50e6231f8(system.object x860e35844c20ac7)[0x00000]中:0
在x4adf554d20d941a6.x50e6e6d123fa4a35.xb5ef8a04e65b87e6(System.String x1f25abf5fb75e795,System.Object的xa860e35844c20ac7)[0x00000]中:0在x59d6a4fc5007b7a4.xdeb77ea37ad74c56.xbbf9a1ead81dd3a1(System.String x1f25abf5fb75e795,System.Object的xa860e35844c20ac7)[0x00000]中:0在x59d6a4fc5007b7a4.x487cdc969fefe3d6 .xbbf9a1ead81dd3a1(System.String x1f25abf5fb75e795,System.Object的xa860e35844c20ac7)[0x00000]中:0在x59d6a4fc5007b7a4.x487cdc969fefe3d6.xf3a1cfbffa44728c()[0x00000]中:0在x59d6a4fc5007b7a4.x487cdc969fefe3d6.x47f176deff0d42e2()[0x00000]中:0在x59d6a4fc5007b7a4。 x487cdc969fefe3d6.x83f07df6a659e05b () [0x00000] in :0 at x59d6a4fc5007b7a4.xcde671c53995c411.xd9db07500873ae98 (Aspose.Words.Document x3664041d21d73fdc, x5941d21d73fdc, x594d.xdeb77ea37ad74c56 xdfde339da46db651) [0x00000] in :0 at Aspose.Words.Document.UpdatePageLayout () [0x00000] in :0 at Aspose.Words.Document.x410db0f4a89a6ef1 (Boolean x24af0daafcd8fb8c) [0x00000] in :0 atDocument Aspose. get_xcde671c53995c411()[0x00000]中:0在Aspose.Words.Document.get_PageCount()[0x00000]中:0在xf989f31a236ff98c.x6c74398bceb133f8.xa2e0b7f7da663553(x28925c9b27b37a46.x8556eed81191af11 x5ac1382edb7bf2c2)[0x00000]中:0在Aspose.Words.Document。 xf381a641001e6830 (System.IO.Stream xcf18e5243f8d5fd3, System.String xafe2f3653ee64ebc, Aspose.Words.Saving.SaveOptions xc27f01f21f67608c) [0x00000] 在 Aspose.Words.Document.Save (System.String fileName, Aspose.Words.SaveOptions xc27f01f21f67608c) [0x00000] saveOptions) [0x00000] in :0 at Aspose.Words.Document.Save (System.String fileName,SaveFormat saveFormat) [0x00000] in :0
在 MonoTest.MainClass.Main (System.String[] args) [0x00000] in :0 [ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException: startIndex + length > this.length 参数名称:长度在 System.String.Substring (Int32的startIndex,的Int32长度)[0x00000]中:0在x6c95d9cf46ff5f25.x0d299f323d241756.x3b67e683e83cab62(System.String xe4115acdf4fbfccc,的Int32 x961016a387451f05)[0x00000]中:0在x4adf554d20d941a6.x50e6e6d123fa4a35.x4469479613bec4d8(Aspose.Words.Node xda5bf54deb817e37)[0x00000]在:0在x4adf554d20d941a6.x50e6e6d123fa4a35.x7be41bff00df2c71(Aspose.Words.Node xda5bf54deb817e37)[0x00000]中:0在x4adf554d20d941a6.x50e6e6d123fa4a35.x699caa1974f95d1a(Aspose.Words.Node xda5bf54deb817e37)[0x00000]中:0在x4adf554d20d941a6.x50e6e6d123fa4a35.x21e4bd206d6231f8(系统.对象 xa860e35844c20ac7) [0x00000] 在:0
在x4adf554d20d941a6.x50e6e6d123fa4a35.xb5ef8a04e65b87e6(System.String x1f25abf5fb75e795,System.Object的xa860e35844c20ac7)[0x00000]中:0在x59d6a4fc5007b7a4.xdeb77ea37ad74c56.xbbf9a1ead81dd3a1(System.String x1f25abf5fb75e795,System.Object的xa860e35844c20ac7)[0x00000]中:0在x59d6a4fc5007b7a4.x487cdc969fefe3d6 .xbbf9a1ead81dd3a1(System.String x1f25abf5fb75e795,System.Object的xa860e35844c20ac7)[0x00000]中:0在x59d6a4fc5007b7a4.x487cdc969fefe3d6.xf3a1cfbffa44728c()[0x00000]中:0在x59d6a4fc5007b7a4.x487cdc969fefe3d6.x47f176deff0d42e2()[0x00000]中:0在x59d6a4fc5007b7a4。 x487cdc969fefe3d6.x83f07df6a659e05b () [0x00000] in :0 at x59d6a4fc5007b7a4.xcde671c53995c411.xd9db07500873ae98 (Aspose.Words.Document x3664041d21d73fdc, x5941d21d73fdc, x594d.xdeb77ea37ad74c56 xdfde339da46db651) [0x00000] in :0 at Aspose.Words.Document.UpdatePageLayout () [0x00000] in :0 at Aspose.Words.Document.x410db0f4a89a6ef1 (Boolean x24af0daafcd8fb8c) [0x00000] in :0 atDocument Aspose. get_xcde671c53995c411()[0x00000]中:0在Aspose.Words.Document.get_PageCount()[0x00000]中:0在xf989f31a236ff98c.x6c74398bceb133f8.xa2e0b7f7da663553(x28925c9b27b37a46.x8556eed81191af11 x5ac1382edb7bf2c2)[0x00000]中:0在Aspose.Words.Document。 xf381a641001e6830 (System.IO.Stream xcf18e5243f8d5fd3, System.String xafe2f3653ee64ebc, Aspose.Words.Saving.SaveOptions xc27f01f21f67608c) [0x00000] 在 Aspose.Words.Document.Save (System.String fileName, Aspose.Words.SaveOptions xc27f01f21f67608c) [0x00000] saveOptions) [0x00000] in :0 at Aspose.Words.Document.Save (System.String fileName,SaveFormat saveFormat) [0x00000] in :0
在 MonoTest.MainClass.Main (System.String[] args) [0x00000] in :0

任何建议表示赞赏。谢谢。

0 投票
2 回答
1435 浏览

java - 堆大小错误 Aspose

在使用 Aspose 将 docx 文件转换为 pdf 文件时出现此错误。这是此 docx 文件为 44Mbheap size的代码

有什么建议么?

0 投票
0 回答
2470 浏览

aspose.words - 转换后的 Pdf 格式与 Word 不同 - Aspose.Words

从 Word 文档保存 Pdf 文档时遇到问题。

我的代码如下:

问题是源文件和目标文件不一样。Word 中第 1 页的最后几行文本在 Pdf 等的第 2 页上。

我在附件中给你源文件和目标文件。

谢谢

源文件目的文件

0 投票
1 回答
1086 浏览

c# - 使用 Aspose.Word 创建报告而不丢失格式

我正在使用Aspose.Words从模板文件(.docx文件类型)创建报告。

使用Aspose.Words修改模板文件并保存到新文件后,模板文件的格式丢失(如粗体文本、 注释等)。

我努力了:

我没想到的是 outputStream 比 inputStream 少得多,尽管我还没有对doc. 这可能是报告文件丢失格式的原因。

我现在应该尝试什么?

0 投票
1 回答
266 浏览

vb.net - 空目录

我有以下问题:我想使用 aspose.words 和 vb.net 创建一个动态目录。我用这段代码做到了:

它有效。问题是,当没有找到目录条目时,我在我的 docx 中获得:

是否可以编写类似的东西(伪代码):

非常感谢,

丹尼尔

0 投票
1 回答
2343 浏览

java - 如何使用 Aspose.Word for Java 在 word 文件中设置水印

这是我的代码。但它不起作用。

0 投票
1 回答
5669 浏览

c# - 在不重新编译整个应用程序的情况下升级依赖 DLL

我们有使用 Aspose.Words.NET 11.10.0 版本的 Windows 服务应用程序现在我们最近升级了 Aspose.Words dll 最新版本 13.7.0

由于我们已经在多个客户端中部署了我们的 Windows 服务应用程序,我们尝试用最新的最新版本替换旧的 Aspose.Words dll。但是当我们重新启动现有的 Windows 应用程序时,它不适用于替换的最新 Aspose.Words dll。

我们通过重新编译引用最新版本的 Aspose.Words dll 的整个 Windows 应用程序解决了这个问题。每次升级 Aspose.Words dll 时,是否需要重新编译和重新部署整个 Windows 服务应用程序?

0 投票
1 回答
6016 浏览

c# - 如何从 HttpInputStream 获取 docx 文件的字节数组?

我正在使用这篇文章中第一个答案的方法:如何从 HttpPostedFile 创建字节数组,但由于某种原因它不适用于 .docx 文件。

在 .docx 文件fileData上显示为{byte[0]},但它适用于 pdf、excel 文件 (xlsx)、2007 年前的 word 文件 (doc) 和图像(即值大于零)。保存到数据库中,fileData 是0x.

如何从 HttpInputStream 获取 docx 文件的字节数组?

更新
我的 web.config 配置为

这适用于大于 4MB 的 xslx 文件,但不适用于小于 80KB 的 docx 文件。

更新 2
我可以使用此处解释的方法来填充 fileData:http: //msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.postedfile.aspx

但是,如果我将该字节数组保存到数据库并尝试写入文件,则它已严重损坏。在这种情况下保存到数据库中看起来像0x00000000000000000000000...

更新 3
这是整个控制器方法,虽然我认为没有必要看到整个事情:

0 投票
1 回答
4219 浏览

c# - .Net Aspose.Words 从 word 文档中读取

我使用 Aspose 写入 word 文件并读取和写入 excel 文件。我试图让 Aspose.Words 从 Word 文档中读取,但我不断收到错误消息。我遵循了 Aspose.com 的示例,但这些示例没有用。我在论坛上发帖了,但我仍然没有收到他们的回复。

我想{fillin "Date" \d ""}从每个 word 文档中读取这些域代码(例如:),它们有多个。一旦我能够提取这些内容,我想将它们放入 aList<string>并验证它们不是重复的。浏览完所有文件后,我需要将该列表打印到 Excel 电子表格中。

有人可以帮我解决这个错误问题或告诉我一个更简单的方法吗?

问题 #1 - 无法识别该文件。

我尝试了不同的技术,但得到了相同的错误 - “UnsupportedFileFormatException 未处理”或“FileCorreptionException 未处理”。我知道文件很好,那么是导致此问题的域代码吗?

问题 #2 - 无法解析符号“字段”或“字段集合”

这来自 Aspose 的开发人员,这会引发上述错误。