We're pleased to announce the release of Spire.Doc 13.12.2. This version supports the "Two Lines in One" function, enhancing the effect of converting Word to PDF. It also adds support for setting the "Horizontal in Vertical" property of Paragraph text, copying styles from template documents when converting Markdown to Docx, and retrieving style change revisions. Meanwhile, some issues that occurred when converting or loading Word documents have also been successfully fixed. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New feature | SPIREDOC-5504 | Supports setting the "Horizontal in Vertical" property of Paragraph text.
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();
|
| New feature | SPIREDOC-11073 | Supports copying styles from template documents when converting Markdown to Docx.
//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);
|
| New feature | – | Supports the "Two Lines in One" function to enhance Word to PDF conversion. |
| New feature | – | Supports retrieving style change revisions.
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();
|
| Bug | SPIREDOC-10859 | Fixed issue with incorrect header appearance when converting Word to PDF. |
| Bug | SPIREDOC-11005 | Fixed issue with loss of image transparency when converting Word to PDF/A-3B. |
| Bug | SPIREDOC-11579 | Fixed issue with incorrect rendering when converting Word to PDF. |
| Bug | SPIREDOC-11623 | Fixed issue where converting Word to PDF threw a "System.NullReferenceException". |
| Bug | SPIREDOC-11644 | Fixed issue with incorrect fonts when converting Word to images. |
| Bug | SPIREDOC-11659 | Fixed issue where copying headers threw an "Object reference not set to an instance of an object" error. |
| Bug | SPIREDOC-11680 | Fixed issue where loading a signed document threw a "System.FormatException" error. |
| Bug | SPIREDOC-11696 | Fixed issue where the doc.HtmlUrlLoadEvent could not be used in the latest version. |
| Bug | SPIREDOC-11700 | Fixed issue with incorrect page number updates in the table of contents. |
Click the link to download Spire.Doc 13.12.2:
More information of Spire.Doc new release or hotfix: