.NET版文档开发工具Aspose.Words v20.9四大新功能演示!

九月已来,.NET版Aspose.Words也为大家带来了9月的新版本!Aspose.Words for .Net是一种高级Word文档处理API,用于执行各种文档管理和操作任务。API支持生成,修改,转换,呈现和打印文档,而无需在跨平台应用程序中直接使用Microsoft Word。

主要特点如下:

  • 公开了VbaReferenceCollection和相关类型
  • 实现了对加载 PDF 文档时脚注的支持。
  • 实现了元文件与EMF+容器的渲染。
  • 扩展了FormField字体格式化API。

>>你可以点击这里下载Aspose.Words for .NET v20.9测试体验

具体更新内容

摘要类别
WORDSNET-20589PDF到DOCX-脚注新功能
WORDSNET522允许整体上将字体格式应用于FormField新功能
WORDSNET-20289通过Words-HTML-Words往返传递正确的边框参数新功能
WORDSNET-13678提供一种从Word文档中删除模板引用的方法新功能
WORDSNET-20986RTF转换为DOCX后,“保留下一个”属性被更改增强功能
WORDSNET-19977Aspose.Words 20.2.0在Alpine Linux容器中不起作用增强功能
WORDSNET-20868加载RTF时出现UnsupportedFileFormatException增强功能

完整更新细则请参考:【Aspose.Words for .NET v20.9更新说明】

新功能解析

①WORDSNET-522——更改了“ FormField.Font”属性的行为

当前允许将字体格式整体应用于FormField。设置新的Font属性后,它们将对整个FormField(包括字段值)生效。下述用例整体说明如何将字体格式应用于FormField:

Document doc = new Document("in.doc");
doc.Range.FormFields[0].Font.Size = 20;
doc.Range.FormFields[0].Font.Color = Color.Red;
doc.Save("out.doc");

②WORDSNET-13678——VbaReferenceCollection和相关类型公开

实现了一个新的VbaReferenceCollection类:

新功能示例解析!.NET版文档开发工具Aspose.Words v20.9发布!4大新功能体验

实现了一个新的VbaReference类:

新功能示例解析!.NET版文档开发工具Aspose.Words v20.9发布!4大新功能体验

实现了一个新的公共枚举VbaReferenceType:

新功能示例解析!.NET版文档开发工具Aspose.Words v20.9发布!4大新功能体验

在VbaProject类中添加了一个新的公共属性:

新功能示例解析!.NET版文档开发工具Aspose.Words v20.9发布!4大新功能体验

用例。说明如何从VbaProject的引用集合中删除一些引用:

public void Main()
{
    Document doc = new Document("test.doc");
 
    // Find and remove the reference with some LibId path.
    const string brokenPath = "brokenPath.dll";
    VbaReferenceCollection references = doc.VbaProject.References;
    for (int i = references.Count - 1; i >= 0; i--)
    {
        VbaReference reference = doc.VbaProject.References[i];
        string path = GetLibIdPath(reference);
        if (path == brokenPath)
            references.RemoveAt(i);
    }
 
    doc.Save("NoBrokenRef.doc"); 
}
 
// Returns string representing LibId path of a specified reference. 
///private static string GetLibIdPath(VbaReference reference)
{
    switch (reference.Type)
    {
        case VbaReferenceType.Registered:
        case VbaReferenceType.Original:
        case VbaReferenceType.Control:
            return GetLibIdReferencePath(reference.LibId);
        case VbaReferenceType.Project:
            return GetLibIdProjectPath(reference.LibId);
        default:
            throw new ArgumentOutOfRangeException();
    }
}
 
// Returns path from a specified identifier of an Automation type library.
/ Please see details for the syntax at [MS-OVBA], 2.1.1.8 LibidReference. 
///private static string GetLibIdReferencePath(string libIdReference)
{
    if (libIdReference != null)
    {
        string[] refParts = libIdReference.Split('#');
        if (refParts.Length > 3)
            return refParts[3];
    }
 
    return "";
}

// Returns path from a specified identifier of an Automation type library.
/ Please see details for the syntax at [MS-OVBA], 2.1.1.12 ProjectReference. 
///private static string GetLibIdProjectPath(string libIdProject)
{
    return (libIdProject != null) ? libIdProject.Substring(3) : "";
}

如果您有任何疑问或需求,请随时加入Aspose技术交流群(642018183),我们很高兴为您提供查询和咨询。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值