aspose word copy 获取某页的内容_6月已至,Aspose.Words又双叒叕更新到v20.6!PDF版本1.5标记过时...
六月已至,.NET版Aspose.Words也為大家?guī)砹?月的新版本!Aspose.Words for .Net是一種高級Word文檔處理API,用于執(zhí)行各種文檔管理和操作任務。API支持生成,修改,轉(zhuǎn)換,呈現(xiàn)和打印文檔,而無需在跨平臺應用程序中直接使用Microsoft Word。
主要特點如下:
- Font.EmphasisMark向公眾公開
- 添加了新的公共屬性ImportFormatOptions.IgnoreHeaderFooter
- 引入了MarkdownSaveOptions類
- 提供了用于控制LINQ Reporting Engine的JSON簡單值識別的選項
>>你可以點擊文末“了解更多”下載Aspose.Words for .NET v20.6測試體驗
具體更新內(nèi)容
WORDSNET-13983 添加功能以支持“標記上的強調(diào)”字體設置 新功能
WORDSNET-19976 字體嵌入效果很好,但是符號未正確保存到PDF 新功能
WORDSNET-20513 檢查Aspose.Words for .NET如何與.NET 5.0一起使用 新功能
WORDSNET-20488 LINQ Reporting Engine-提供一種使用JsonDataSource的準確格式解析日期時間值的方法 新功能
WORDSNET-19979 LINQ Reporting Engine-提供一種模式,可根據(jù)JSON表示法本身確定JSON簡單值的類型 新功能
WORDSNET-20297 添加使用SaveOptions創(chuàng)建MarkdownSaveOptions的功能 新功能
WORDSNET-20491 加載PDF時發(fā)生System.IO.FileLoadException 增強功能
WORDSNET-20492 PDF到Word的轉(zhuǎn)換,有時在新頁面上重復行 增強功能
公共API更改
①添加了新的公共類MarkdownSaveOptions
/// /// Class to specify additional options when saving a document into the format./// public class MarkdownSaveOptions : TxtSaveOptionsBase暫時只有以下幾個公共API:
/// /// Specifies the format in which the document will be saved if this save options object is used./// Can only be ./// public override SaveFormat SaveFormat注意,將TxtSaveOptionsBase.PreserveTableLayout移至TxtSaveOptions.PreserveTableLayout:
/// /// Specifies whether the program should attempt to preserve layout of tables when saving in the plain text format./// The default value is false./// public bool PreserveTableLayout用例。說明如何創(chuàng)建和使用MarkdownSaveOptions對象:
DocumentBuilder builder = new DocumentBuilder();builder.Writeln("Some text!"); MarkdownSaveOptions saveOptions = (MarkdownSaveOptions)SaveOptions.CreateSaveOptions(SaveFormat.Markdown);builder.Document.Save("TestDocument.md", saveOptions);②添加了新的公共屬性Font.EmphasisMark
/// /// Gets or sets the emphasis mark applied to this formatting./// public EmphasisMark EmphasisMark強調(diào)標記是一個附加字符,它在下面的枚舉中指定的主字符字形之上或之下呈現(xiàn)。
/// /// Specifies possible types of emphasis mark./// /// /// Names borrowed from https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.word.wdemphasismark?view=word-pia/// public enum EmphasisMark{????/// ????/// No emphasis mark.????/// ????None = 0x00,??????/// ????/// Emphasis mark is a solid black circle displayed above text.????/// ????OverSolidCircle = 0x01,??????/// ????/// Emphasis mark is a comma character displayed above text.????/// ????OverComma = 0x02,??????/// ????/// Emphasis mark is an empty white circle displayed above text.????/// ????OverWhiteCircle = 0x03,??????/// ????/// Emphasis mark is a solid black circle displayed below text.????/// ????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);③添加了新的公共屬性ImportFormatOptions.IgnoreHeaderFooter
/// /// 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.///默認情況下,保留Word的行為是對的。用例:
Document dstDocument = new Document(dstDocumentPath);Document srcDocument = new Document(srcDocumentPath); ImportFormatOptions importFormatOptions = new ImportFormatOptions();importFormatOptions.IgnoreHeaderFooter = false; dstDocument.AppendDocument(srcDocument, ImportFormatMode.KeepSourceFormatting, importFormatOptions);;④添加了新的公共屬性MarkdownSaveOptions.TableContentAlignment
/// /// Gets or sets a value that specifies how to align contents in tables/// when exporting into the format./// The default value is . /// public TableContentAlignment TableContentAlignment { get; set; }此外,還添加了一個新的公共枚舉:
/// /// Allows to specify the alignment of the content of the table to be used when exporting into Markdown format./// public enum TableContentAlignment{ /// /// The alignment will be taken from the first paragraph in corresponding table column. /// Auto, /// /// The content of tables will be aligned to the Left. /// Left, /// /// The content of tables will be aligned to the Center. /// Center, /// /// The content of tables will be aligned to the Right. /// Right}用例。說明導出到Markdown時如何在表格內(nèi)對齊內(nèi)容:
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技術(shù)交流群(642018183),我們很高興為您提供查詢和咨詢。
總結(jié)
以上是生活随笔為你收集整理的aspose word copy 获取某页的内容_6月已至,Aspose.Words又双叒叕更新到v20.6!PDF版本1.5标记过时...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: git本地ben远程分支_git 本地分
- 下一篇: 运行时间_如何测量嵌入式软件运行时间?