提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
原创|产品更新|编辑:李显亮|2020-06-04 10:26:35.013|阅读 146 次
概述:Aspose.Words for .Net更新至新版本v20.6,Font.EmphasisMark向公众公开,引入了MarkdownSaveOptions类,PDF版本1.5标记为过时,欢迎下载体验。
# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>
六月已至,.NET版Aspose.Words也为大家带来了6月的新版本!Aspose.Words for .Net是一种高级Word文档处理API,用于执行各种文档管理和操作任务。API支持生成,修改,转换,呈现和打印文档,而无需在跨平台应用程序中直接使用Microsoft Word。
主要特点如下:
>>你可以点击这里下载Aspose.Words for .NET v20.6测试体验
key | 概述 | 类别 |
---|---|---|
WORDSNET-13983 | 添加功能以支持“标记上的强调”字体设置 | 新功能 |
WORDSNET-19976 | 字体嵌入效果很好,但是符号未正确保存到PDF | 新功能 |
WORDSNET-20513 | 检查Aspose.Words for .NET如何与.NET 5.0一起使用 | 新功能 |
WORDSNET-20488 | LINQ Reporting Engine-提供一种使用JsonDataSource的准确格式解析日期时间值的方法 | 新功能 |
WORDSNET-19979 | LINQ Reporting Engine-提供一种模式,可根据JSON表示法本身确定JSON简单值的类型 | 新功能 |
WORDSNET-20297 | 添加使用SaveOptions创建MarkdownSaveOptions的功能 | 新功能 |
WORDSNET-20491 | 加载PDF时发生System.IO.FileLoadException | 增强功能 |
WORDSNET-20492 | PDF到Word的转换,有时在新页面上重复行 | 增强功能 |
/// <summary> /// Class to specify additional options when saving a document into the <see cref="Words.SaveFormat.Markdown"/> format. /// </summary> public class MarkdownSaveOptions : TxtSaveOptionsBase
暂时只有以下几个公共API:
/// <summary> /// Specifies the format in which the document will be saved if this save options object is used. /// Can only be <see cref="Words.SaveFormat.Markdown"/>. /// </summary> public override SaveFormat SaveFormat
注意,将TxtSaveOptionsBase.PreserveTableLayout移至TxtSaveOptions.PreserveTableLayout:
/// <summary> /// Specifies whether the program should attempt to preserve layout of tables when saving in the plain text format. /// The default value is <b>false</b>. /// </summary> public bool PreserveTableLayout
用例。说明如何创建和使用MarkdownSaveOptions对象:
DocumentBuilder builder = new DocumentBuilder(); builder.Writeln("Some text!"); MarkdownSaveOptions saveOptions = (MarkdownSaveOptions)SaveOptions.CreateSaveOptions(SaveFormat.Markdown); builder.Document.Save("TestDocument.md", saveOptions);
/// <summary> /// Gets or sets the emphasis mark applied to this formatting. /// </summary> public EmphasisMark EmphasisMark
强调标记是一个附加字符,它在下面的枚举中指定的主字符字形之上或之下呈现。
/// <summary> /// Specifies possible types of emphasis mark. /// </summary> /// <dev> /// Names borrowed from //docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.word.wdemphasismark?view=word-pia /// </dev> public enum EmphasisMark { /// <summary> /// No emphasis mark. /// </summary> None = 0x00, /// <summary> /// Emphasis mark is a solid black circle displayed above text. /// </summary> OverSolidCircle = 0x01, /// <summary> /// Emphasis mark is a comma character displayed above text. /// </summary> OverComma = 0x02, /// <summary> /// Emphasis mark is an empty white circle displayed above text. /// </summary> OverWhiteCircle = 0x03, /// <summary> /// Emphasis mark is a solid black circle displayed below text. /// </summary> UnderSolidCircle = 0x04, }
用例。说明如何通过DocumentBuilder设置Font.EmphasisMark:
Document document = new Document(); DocumentBuilder builder = new DocumentBuilder(document); builder.Font.EmphasisMark = EmphasisMark.UnderSolidCircle; builder.Write("Emphasis text"); builder.Writeln(); builder.Font.ClearFormatting(); builder.Write("Simple text"); document.Save(savePath, saveOptions);
/// <summary> /// Gets or sets a boolean value that specifies that source formatting of headers/footers content ignored /// if ImportFormatMode.KeepSourceFormatting mode is used. /// The default value is true. /// </summary>
默认情况下,保留Word的行为是对的。用例:
Document dstDocument = new Document(dstDocumentPath); Document srcDocument = new Document(srcDocumentPath); ImportFormatOptions importFormatOptions = new ImportFormatOptions(); importFormatOptions.IgnoreHeaderFooter = false; dstDocument.AppendDocument(srcDocument, ImportFormatMode.KeepSourceFormatting, importFormatOptions);;
/// <summary> /// Gets or sets a value that specifies how to align contents in tables /// when exporting into the <see cref="Words.SaveFormat.Markdown"/> format. /// The default value is <see cref="Saving.TableContentAlignment.Auto"/>. /// </summary> public TableContentAlignment TableContentAlignment { get; set; }
此外,还添加了一个新的公共枚举:
/// <summary> /// Allows to specify the alignment of the content of the table to be used when exporting into Markdown format. /// </summary> public enum TableContentAlignment { /// <summary> /// The alignment will be taken from the first paragraph in corresponding table column. /// </summary> Auto, /// <summary> /// The content of tables will be aligned to the Left. /// </summary> Left, /// <summary> /// The content of tables will be aligned to the Center. /// </summary> Center, /// <summary> /// The content of tables will be aligned to the Right. /// </summary> Right }
用例。说明导出到Markdown时如何在表格内对齐内容:
MarkdownSaveOptions saveOptions = new MarkdownSaveOptions(); // Makes all paragraphs inside table to be aligned to Left. saveOptions.TableContentAlignment = TableContentAlignment.Left; builder.Document.Save("left.md", saveOptions); // Makes all paragraphs inside table to be aligned to Right. saveOptions.TableContentAlignment = TableContentAlignment.Right; builder.Document.Save("right.md", saveOptions); // Makes all paragraphs inside table to be aligned to Center. saveOptions.TableContentAlignment = TableContentAlignment.Center; builder.Document.Save("center.md", saveOptions); // Makes all paragraphs inside table to be aligned automatically. // The alignment in this case will be taken from the first paragraph in corresponding table column. saveOptions.TableContentAlignment = TableContentAlignment.Auto; builder.Document.Save("auto.md", saveOptions);Aspose是目前国内外非常火爆且功能强大的文件格式敏捷开发控件,但因为产品众多、技术问题复杂等因素,也常常遭受开发人员吐槽。如果您也正在使用Aspose相关产品,点击下方按钮,来谈谈Aspose的优劣,您的感受对我们相当宝贵哦~
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@cahobeh.cn
知名C/C++开发工具CLion全新发布v2024.3,新版本新语言引擎有显著改进等,欢迎下载新版体验!
强大的VS插件CodeRush已正式发布v24.2.3,新版本现在可以运行xUnit.Net v3测试等,欢迎下载最新版体验!
Spire.PDF 10.12.4 最新版本支持在进行多页打印时设置自动旋转方向。同时,一些已知问题也在本次更新中被成功修复,例如打印 PDF 文档时内容丢失的问题,欢迎下载体验~
日程安排控件dhtmlxScheduler v7.2全新发布,新版本增强并增加了编辑、修改等多个操作体验,欢迎下载最新版试用~
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@cahobeh.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢