Aspose.Words 是一种高级Word文档处理API,用于执行各种文档管理和操作任务。API支持生成,修改,转换,呈现和打印文档,而无需在跨平台应用程序中直接使用Microsoft Word。
Aspose API 支持流行文件格式处理,并允许将各类文档导出或转换为固定布局文件格式和最常用的图像/多媒体格式。
Aspose.Words for .NET 最新下载(qun:761297826)https://www.evget.com/product/564/download
主要特点
此每月定期版本有 115 项改进和修复。最值得注意的是:
- 已实现将文档页面或形状保存为 EPS 格式的功能。
- 添加了从数字签名文档中以字节数组形式检索数字签名值的功能。
- Row 和 Cell 类已通过新的公共成员进行了扩展。
- MailMerge.GetRegionsHierarchy 和 MailMerge.GetFieldNamesForRegion 方法现在支持 Mustache 标记。
- LINQ 报告引擎模板语法现在支持 ElementAt 和 ElementAtOrDefault 扩展方法。
涵盖此版本中所有更改的问题的完整列表
钥匙 | 概括 | 类别 |
---|---|---|
WORDSNET-24965 | 将 Cell.PreviousCell、Cell.NextCell、Row.PreviousRow、Row.NextRow 属性设置为公共 | 新功能 |
WORDSNET-25420 | 考虑提供一种将数字签名提取为字节数组的方法 | 新功能 |
WORDSNET-24384 | 表格单元格中的文本换行不正确 | 新功能 |
WORDSNET-24778 | 渲染后形状的右边缘被切割 | 新功能 |
WORDSNET-24777 | 渲染后表格列的宽度不正确。 | 新功能 |
WORDSNET-24830 | 图像渲染不正确 | 新功能 |
WORDSNET-25017 | 表格呈现得有点窄,导致超链接换行不正确 | 新功能 |
WORDSNET-25130 | 重新分配后表格宽度发生变化 | 新功能 |
WORDSNET-25382 | 渲染后表格布局不正确 | 新功能 |
WORDSNET-25035 | 加载固定页面 HTML 文档时发出警告 | 新功能 |
WORDSNET-13420 | 段落与输出 PDF 中的形状重叠 | 新功能 |
WORDSNET-12865 | PDF 中的表格移向页面右侧边缘 | 新功能 |
WORDSNET-12300 | 表格中的图像在生成的 PDF 中被截断 | 新功能 |
WORDSNET-12617 | 将 Word 文档转换为 PDF 时页脚中的文本错位 | 新功能 |
WORDSNET-13888 | 表格渲染的 DOCM 到 PDF 转换问题 | 新功能 |
WORDSNET-14560 | HTML 到 PDF 转换:表格渲染 | 新功能 |
WORDSNET-12870 | 表格渲染的 DOC 到 XPS 转换问题 | 新功能 |
WORDSNET-14269 | DOCX 到 PDF 转换问题与表格渲染有关 | 新功能 |
WORDSNET-14626 | 当单元格中存在图像时,表格的宽度会缩小 | 新功能 |
WORDSNET-15163 | DOCX 到 PDF 转换中的图像对齐问题 | 新功能 |
WORDSNET-15615 | UpdateTableLayout 方法在 Word 到 PDF 转换中的使用 | 新功能 |
WORDSNET-16205 | 段落呈现在上一页上 | 新功能 |
WORDSNET-16237 | DOCX 到 Html修复了表格位置的转换问题 | 新功能 |
WORDSNET-16131 | 单元格的文本换行到输出 PDF 中的下一行 | 新功能 |
WORDSNET-16466 | 从 DOC 转换为 PDF 后图像重叠 | 新功能 |
WORDSNET-16992 | PDF 中的图片彼此略有重叠 | 新功能 |
WORDSNET-17861 | 表格内容的 DOCX 到 PDF 转换问题 | 新功能 |
WORDSNET-18482 | 表格行在 Word 中显示在第 4 页,但在 AW 中显示在第 5 页 | 新功能 |
WORDSNET-18203 | 文档标题中的日期在输出 PDF 中无法正确呈现 | 新功能 |
WORDSNET-25259 | 支持 LINQ 报告引擎模板语法的 ElementAt 扩展方法 | 新功能 |
WORDSNET-24195 | 支持渲染为EPS | 新功能 |
WORDSNET-18714 | 生成的 PDF 中的表格宽度不正确 | 新功能 |
WORDSNET-19952 | DOCX 转换为 PDF 后形状(徽标)位置发生变化 | 新功能 |
WORDSNET-20177 | 图片向右页边距移动,导致 PDF 中部分渲染 | 新功能 |
WORDSNET-20811 | 在 DOCM 到 PDF 转换期间保留横向部分标题中的表格列宽度 | 新功能 |
WORDSNET-20818 | UpdatePageLayout 和 UpdateTableLayout 使用 .NET 更改了打印文档布局 | 新功能 |
WORDSNET-21256 | Document.UpdateTableLayout 更改输出 PDF 中文档页脚的布局 | 新功能 |
WORDSNET-21638 | DOCX 转换为 PDF 后图像被裁剪 | 新功能 |
WORDSNET-21746 | 转换为 PDF 后表格不正确 | 新功能 |
WORDSNET-22344 | Word 到 PDF 转换标题中的表格对齐问题 | 新功能 |
WORDSNET-22714 | 将 DOCX 转换为 PDF 时的设计错误 | 新功能 |
WORDSNET-22755 | 将 DOCX 文件转换为 PDF 时单元格的宽度不正确 | 新功能 |
WORDSNET-22819 | 徽标移至 PDF 的中心 | 新功能 |
WORDSNET-23978 | DOCX 到 PDF 转换时表格列宽不正确 | 新功能 |
WORDSNET-23977 | 横向页面上的标题渲染不正确 | 新功能 |
WORDSNET-24091 | 横向页面上带有表格的标题渲染不正确 | 新功能 |
WORDSNET-24103 | 将 DOCX 转换为 PDF 时标题布局发生变化 | 新功能 |
WORDSNET-24254 | 渲染文档时图像被截断 | 新功能 |
WORDSNET-24564 | PDF 中呈现空白页面 | 新功能 |
WORDSNET-25467 | 读取损坏的 MOBI 文件时抛出更好的错误消息 | 强化 |
WORDSNET-24916 | 表格呈现为比源文档中的稍窄 | 强化 |
WORDSNET-25494 | 表格中的文本换行不正确 | 强化 |
WORDSNET-17445 | “另存为 PDF”中页眉中的图像被截断 | 强化 |
WORDSNET-19131 | 将 Word 转换为 PDF 时表格中的图像未居中 | 强化 |
WORDSNET-20838 | Document.UpdateTableLayout 更改输出 PDF 中表格的布局 | 强化 |
WORDSNET-21659 | 表格内的图像以 PDF 格式被截取 | 强化 |
WORDSNET-24279 | 渲染后表格右边框不可见 | 强化 |
WORDSNET-25512 | 检查AllStyles2003.docx资源中是否需要customXxml部分 | 强化 |
WORDSNET-25418 | FindReplaceOptions.ApplyFont.Color 未应用 | 漏洞 |
WORDSNET-25404 | MailMerge.GetRegionsHierarchy 和 MailMerge.GetFieldNamesForRegion 不适用于小胡子语法 | 漏洞 |
WORDSNET-25330 | 在 GroupDocs.Editor 内转换文档时,AW.NET 中出现内存泄漏问题 | 漏洞 |
WORDSNET-25601 | 文本呈现为豆腐 | 漏洞 |
WORDSNET-25602 | 文本呈现为豆腐 2 | 漏洞 |
WORDSNET-25574 | 从 DOCX 转换为 XLSX 后,细胞背景丢失 | 漏洞 |
WORDSNET-25162 | 字体样式下划线不起作用 | 漏洞 |
WORDSNET-25560 | 新版本的 Aspose.Words 中的渲染性能下降 | 漏洞 |
WORDSNET-25257 | 从 WPS 中创建的 DOC 中错误提取 OLE 对象 | 漏洞 |
WORDSNET-25514 | 将 HTML 保存到 MOBI 时出现 InvalidCastException | 漏洞 |
WORDSNET-25363 | 图像保存到 SVG 时不会保留超链接 | 漏洞 |
WORDSNET-25575 | MHT 转换为 PCL 后图像颜色反转 | 漏洞 |
WORDSNET-25408 | DOCX 合并问题 | 漏洞 |
WORDSNET-25543 | 插入 SVG+XML 图像时出错 | 漏洞 |
WORDSNET-25492 | 首次调用 UpdateFields 后 REF 字段未正确更新 | 漏洞 |
WORDSNET-25409 | Aspose.Words 未正确更新 TOC | 漏洞 |
WORDSNET-25526 | MailMerge.GetFieldNames() 中未列出 MergeBarcode 字段名称 | 漏洞 |
WORDSNET-25518 | 使用 DML 读取文档时无限循环 | 漏洞 |
WORDSNET-25432 | 打开/保存文档后 HTML AltChunk 丢失文本颜色 | 漏洞 |
WORDSNET-25566 | 小写字母文本渲染不正确 | 漏洞 |
WORDSNET-23448 | DOCX 转 PDF:表格内的一些图像被推回到上一页 | 漏洞 |
WORDSNET-25448 | DOCX 到 PDF:转换后页面丢失 | 漏洞 |
WORDSNET-25437 | 转换为 PDF 时,在损坏的表格单元格中不遵守寡妇/孤儿规则 | 漏洞 |
WORDSNET-25306 | 渲染文档后中文文本丢失 | 漏洞 |
WORDSNET-25410 | 如果小数部分之一具有不同的字体大小,则边界计算不正确 | 漏洞 |
WORDSNET-25497 | 合并 PDF 文档后图形质量会下降 | 漏洞 |
WORDSNET-24260 | DOCX 到 PDF:表格溢出到页脚 | 漏洞 |
WORDSNET-25535 | 使用 Shaping.HarfBuzz 时,PdfSaveOptions.OptimizeOutput 会产生不正确的输出 | 漏洞 |
WORDSNET-25532 | 渲染文档后不保留图像比例 | 漏洞 |
WORDSNET-25393 | 更新字数时抛出 NullReferenceException | 漏洞 |
WORDSNET-25192 | 导出为 HTML 后列表格式不正确 | 漏洞 |
WORDSNET-25191 | 导出为 HTML 后列表格式不正确 | 漏洞 |
WORDSNET-25190 | 导出为 HTML 后列表不正确 | 漏洞 |
WORDSNET-24856 | 改进 HTML 列表导出 | 漏洞 |
WORDSNET-25470 | 打开 HTML 文件时抛出 Aspose.Words.FileCorruptedException | 漏洞 |
WORDSNET-23914 | 公式中分数线的位置不正确 | 漏洞 |
WORDSNET-25525 | 如果嵌入图像位于数学公式的顶层,则顶部和底部偏移不正确 | 漏洞 |
WORDSNET-25521 | 尝试将 DocumentBuilder 移动到 OfficeMath 内的书签时引发 InvalidCastException | 漏洞 |
WORDSNET-25444 | DOCX 到 PDF:文本改变颜色 | 漏洞 |
WORDSNET-25365 | 如果运算符字形 (+、-) 是“内联”分数的一部分,则在转换为 PDF 后会发生更改 | 漏洞 |
WORDSNET-25454 | 文件被 Aspose.Words 错误地检测为 PDF | 漏洞 |
WORDSNET-25482 | 保存后占位符文本丢失 | 漏洞 |
WORDSNET-25496 | 将文档与其本身进行比较会产生看不见的修订 | 漏洞 |
WORDSNET-25474 | 将 HTML 保存到 DOCX 时兼容模式发生变化 | 漏洞 |
WORDSNET-23854 | 确保将 HTML 保存到 DOCX 时兼容模式发生变化 | 漏洞 |
WORDSNET-25458 | 饼图中的百分比数字不正确 | 漏洞 |
WORDSNET-12871 | 表格文本呈现的 DOC 到 XPS 转换问题 | 漏洞 |
WORDSNET-25572 | 字体后备不适用于 Wingdings 字体 | 漏洞 |
WORDSNET-23742 | 从 DOC 保存到 ODT 时,单元格边距发生变化 | 漏洞 |
WORDSNET-25504 | 两次附加文档时格式错误 | 漏洞 |
WORDSNET-25446 | DOCX 到 PDF:符号未正确转换 | 漏洞 |
WORDSNET-24990 | 组件内容的项目符号格式已更改 | 漏洞 |
WORDSNET-25486 | 删除表格行后渲染文档时抛出 NullReferenceException | 漏洞 |
WORDSNET-25487 | HTML 转换为空白结果 DOCX | 漏洞 |
WORDSNET-25364 | 默认字体系列写入 LI 元素 | 漏洞 |
WORDSNET-25537 | 渲染后表格行移至上一页 | 漏洞 |
WORDSNET-20577 | Aspose.Words 比 .NET Core 需要更多的时间和内存 | 漏洞 |
公
公共 API 和向后不兼容的更改
本部分列出了 Aspose.Words 23.7 中引入的公共 API 更改。它不仅包括新的和过时的公共方法,还描述了 Aspose.Words 中可能影响现有代码的幕后行为的任何变化。引入的任何可被视为回归并修改现有行为的行为都特别重要,并记录在此处。
添加了从数字签名文档中以字节数组形式获取数字签名值的功能
相关问题:WORDSNET-25420
添加了从数字签名文档获取数字签名值到Aspose.Words.DigitalSignatures.DigitalSignature类的功能:
/// <summary>
/// Gets an array of bytes representing a signature value.
/// </summary>
public byte[] SignatureValue { get; }
使用案例
Document doc = new Document("docWithSign.docx");
foreach (DigitalSignature digitalSignature in doc.DigitalSignatures)
{
string signatureValue = Convert.ToBase64String(digitalSignature.SignatureValue);
Console.WriteLine("Base64 signature value is: {0}", signatureValue);
}
// The code produces the following output:
// Base64 signature value is: AJjRFbflcj+H7VUZ9Q/9rpbavjT7TC10M5orYCRYnEIwyPCtTman8+na4ynclQtBFFgT7uJoHyuHStleXwnbbj6AVNp/B1oCtlEcg9t7WjsgLlm7LQsr6PCCCkgWYNEOwe3s6Wpfop9qkyEEBxATgfpfbbdodB/wO0elS/Ei+dfUmu
添加了新的 EPS 图像格式
与 WORDSNET-24195 相关
文档页面或形状现在可以保存为EPS格式。新的 EPS 值被添加到SaveFormat枚举中。
使用案例
此用例解释了如何将文档另存为 EPS 图像:
// Open some document.
Document doc = new Document("document.docx");
// Save the second page as EPS image.
ImageSaveOptions saveOptions = new ImageSaveOptions(SaveFormat.Eps);
saveOptions.PageSet = new PageSet(1);
doc.Save("image.eps", saveOptions);
使用案例
此用例解释了如何将任何特定形状保存为 EPS 图像:
// Open some document.
Document doc = new Document("document.docx");
// Save the shape as EPS image.
ImageSaveOptions saveOptions = new ImageSaveOptions(SaveFormat.Eps);
Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
ShapeRenderer renderer = shape.GetShapeRenderer();
renderer.Save("image.eps", saveOptions);
添加了新的公共属性 Row.NextRow、Row.PreviousRow、Cell.NextCell 和 Cell.PreviousCell
相关问题:WORDSNET-24965
以下公共属性已添加到Row类中:
/// <summary>
/// Gets the next Row node.
/// </summary>
/// <remarks>
/// The method can be used when you need to have typed access to table rows.
/// If a StructuredDocumentTag node is found in a table instead of a row,
/// it is automatically traversed to get a row contained within.
/// </remarks>
public Row NextRow { get; }
/// <summary>
/// Gets the previous Row node.
/// </summary>
/// <remarks>
/// The method can be used when you need to have typed access to table rows.
/// If a StructuredDocumentTag node is found in a table instead of a row,
/// it is automatically traversed to get a row contained within.
/// </remarks>
public Row PreviousRow { get; }
使用案例
此用例解释了如何枚举所有表格单元格:
Document doc = new Document(fileName);
Table table = doc.FirstSection.Body.Tables[0];
// Enumerate through all cells of the table.
for (Row row = table.FirstRow; row != null; row = row.NextRow)
{
for (Cell cell = row.FirstCell; cell != null; cell = cell.NextCell)
{
Console.WriteLine(cell.GetText());
}
}
如果加载的 HTML 文档具有固定页面结构,则会发出警告
相关问题:WORDSNET-25035
Aspose.Words 不支持加载固定页面 HTML 文档(例如,在SaveFormat.HtmlFixed中保存时生成的文档)。如果Aspose.Words检测到加载的HTML文档具有固定页面结构,它将发出以下警告:
WarningSource.Html
WarningType.MajorFormattingLoss
"The document is fixed-page HTML. Its structure may not be loaded correctly."
MailMerge.GetRegionsHierarchy 和 MailMerge.GetFieldNamesForRegion 方法中支持的胡子标记
相关问题:WORDSNET-25404
现在,当MailMerge.UseNonMergeFields选项为 true时, MailMerge.GetRegionsHierarchy方法会返回胡须区域和胡须字段。
现在,当MailMerge.UseNonMergeFields选项为 true时, MailMerge.GetFieldNamesForRegion方法接受胡须区域名称并返回胡须字段名称。
引入了 MustacheTag类:
/// <summary>
/// Represents "mustache" tag.
/// </summary>
public class MustacheTag
{
/// <summary>
/// Gets the run that contains the beginning of the tag.
/// </summary>
public Run ReferenceRun { get; }
/// <summary>
/// Gets the zero-based starting position of the tag from the start of the <see cref="ReferenceRun"/>.
/// </summary>
public int ReferenceOffset { get; }
/// <summary>
/// Gets the text of the tag.
/// </summary>
public string Text { get; }
}
StartMustacheTag、EndMustacheTag 和 MustacheTags 属性已添加到 MailMergeRegionInfo 类中:
public class MailMergeRegionInfo
{
/// <summary>
/// Returns a start "mustache" tag for the region.
/// </summary>
public MustacheTag StartMustacheTag { get; }
/// <summary>
/// Returns an end "mustache" tag for the region.
/// </summary>
public MustacheTag EndMustacheTag { get; }
/// <summary>
/// Returns a list of child "mustache" tags.
/// </summary>
public IList<MustacheTag> MustacheTags { get; }
}
使用案例
此用例解释了如何使用 MustacheTag:
Document document = new Document("Template.docx");
document.MailMerge.UseNonMergeFields = true;
MailMergeRegionInfo hierarchy = document.MailMerge.GetRegionsHierarchy();
foreach (MustacheTag mustacheTag in hierarchy.MustacheTags)
Console.WriteLine(mustacheTag.Text);
foreach (MailMergeRegionInfo region in hierarchy.Regions)
{
Console.WriteLine(region.StartMustacheTag.Text);
Console.WriteLine(region.EndMustacheTag.Text);
}
LINQ 报告引擎模板语法支持的 ElementAt 和 ElementAtOrDefault 扩展方法
相关问题:WORDSNET-25259
从现在开始,您可以在 LINQ 报告引擎模板语法中使用ElementAt和ElementAtOrDefault扩展方法,如下所示:
<<[persons.ElementAt(3).Name]>>
<<[persons.ElementAtOrDefault(5)?.Name]>>