Spire.Doc 13.12.2 现已正式发布。本版本支持双行合一功能,强化了 Word 转 PDF 的效果。同时,支持设置段落文本的“Horizontal in Vertical”属性、Markdown 转 Docx 时从模板文档复制样式,以及获取样式更改修订。更多详情如下。
新功能:
- 支持设置段落文本的“Horizontal in Vertical”属性。
- Markdown 转 Docx 时,支持从模板文档复制样式。
- 支持双行合一功能,强化 Word 转 PDF 的效果。
- 支持获取样式更改修订。
Document doc = new Document();
Section section = doc.AddSection();
Spire.Doc.Documents.Paragraph paragraph = section.AddParagraph();
Spire.Doc.Fields.TextRange farEastLayout = paragraph.AppendText("test");
FarEastLayout style = new FarEastLayout();
style.Vertical = true;
farEastLayout.CharacterFormat.FarEastLayout = style;
doc.SaveToFile(outputFile, FileFormat.Docx);
doc.Close();
//Load template documents with existing styles
Document temple = new Document();
temple.LoadFromFile("temple.docx");
//Load markdown file
Document doc = new Document();
doc = new Document(@"Doc.md");
//Copy styles from template documents
doc.CopyStylesFromTemplate(temple);
//Save
doc.SaveToFile(@"Doc.docx", Spire.Doc.FileFormat.Docx2016);
Document doc = new Document();
doc.LoadFromFile(inputFile);
RevisionInfoCollection revisionInfoCollection = doc.GetRevisionInfos();
StringBuilder sb = new StringBuilder();
foreach (RevisionInfo revisionInfo in revisionInfoCollection)
{
if (revisionInfo.RevisionType == RevisionType.FormatChange)
{
if (revisionInfo.OwnerObject is Spire.Doc.Fields.TextRange)
{
TextRange range = (TextRange)revisionInfo.OwnerObject;
sb.AppendLine("TextRange:" + range.Text + "\r\n");
doc.RevisionsView = RevisionsView.Original;
sb.AppendLine("Original style:" + "isBold:" + range.CharacterFormat.Bold + ";" + "TextColor:" + range.CharacterFormat.TextColor + ";HighlightColor:" + range.CharacterFormat.HighlightColor + ";FontName:" + range.CharacterFormat.FontName + ";UnderlineStyle:" + range.CharacterFormat.UnderlineStyle + "\r\n");
doc.RevisionsView = RevisionsView.Final;
sb.AppendLine("Final style:" + "isBold:" + range.CharacterFormat.Bold + ";" + "TextColor:" + range.CharacterFormat.TextColor + ";HighlightColor:" + range.CharacterFormat.HighlightColor + ";FontName:" + range.CharacterFormat.FontName + ";UnderlineStyle:" + range.CharacterFormat.UnderlineStyle + "\r\n");
}
}
}
File.WriteAllText(outputFile, sb.ToString());
doc.Close();
问题修复:
- 修复了 Word 转 PDF 时页眉效果不正确的问题。
- 修复了 Word 转 PDF/A-3B 时图片透明度丢失的问题。
- 修复了 Word 转 PDF 时效果不正确的问题。
- 修复了 Word 转 PDF 时抛出“System.NullReferenceException”的问题。
- 修复了 Word 转图片时字体不正确的问题。
- 修复了复制页眉时报“Object reference not set to an instance of an object”的问题。
- 修复了加载签名文档时抛“System.FormatException”错误的问题。
- 修复了 doc.HtmlUrlLoadEvent 在最新版本中不能使用的问题。
- 修复了目录页码更新不正确的问题。
获取 Spire.Doc 13.12.2,请点击:







