We are excited to announce the release of Spire.Office 10.9.0. In this version, Spire.Doc exposes core interfaces for fine-grained document styling control; Spire.XLS supports creating and modifying Equations; Spire.Presentation fixes an issue where documents failed to open; Spire.PDF improves OFD to PDF conversion; Spire.DocViewer adjusts its security-related dependencies; Spire.PDFViewer adds a platform-agnostic .NET 7.0 version; Spire.Barcode fixes a font issue. Besides, a lot of known issues are fixed successfully in this version. More details are listed below.
In this version, the most recent versions of Spire.Doc, Spire.PDF, Spire.XLS, Spire.Presentation, Spire.Barcode, Spire.DocViewer, and Spire.PDFViewer are included.
DLL Versions:
- Spire.Doc.dll v13.9.10
- Spire.PDF.dll v11.9.17
- Spire.XLS.dll v15.9.7
- Spire.Presentation.dll v10.9.3
- Spire.Barcode.dll v7.4.1
- Spire.Email.dll v6.6.3
- Spire.DocViewer.Forms.dll v8.9.4
- Spire.PDFViewer.Asp.dll v8.2.1
- Spire.PDFViewer.Forms.dll v8.2.1
- Spire.Spreadsheet.dll v7.5.2
- Spire.OfficeViewer.Forms.dll v8.8.0
- Spire.DataExport.dll 4.9.0
- Spire.DataExport.ResourceMgr.dll v2.1.0
Here is a list of changes made in this release
Spire.Doc
| Category | ID | Description |
| New feature | - | Exposes core style interfaces ICharacterStyle, IListStyle, and ITableStyle to enable fine-grained document styling control. |
| New feature | SPIREDOC-7186 SPIREDOC-7365 | Removes CharacterFormat from IStyle, now implemented in CharacterStyle, ParagraphStyle, and TableStyle.
IStyle style = document.Styles.FindByName("Normal");
if (style != null && style is ICharacterStyle)
{
ICharacterStyle cStyle = style as ICharacterStyle;
cStyle.CharacterFormat.FontName = "cambria";
cStyle.CharacterFormat.FontSize = 14;
cStyle.CharacterFormat.Bold = true;
cStyle.CharacterFormat.TextColor = Color.FromArgb(42, 123, 136);
}
|
| New feature | SPIREDOC-2945 SPIREDOC-4871 | Adds the IStyle.RemoveSelf() method to remove a style from the document.
string pStyleName = "testStyle";
Document document = new Document();
ParagraphStyle pStyle = (ParagraphStyle)document.Styles.Add(StyleType.ParagraphStyle, pStyleName);
pStyle.CharacterFormat.FontName = "Calibri";
pStyle.CharacterFormat.FontSize = 16;
pStyle.CharacterFormat.Bold = true;
pStyle.CharacterFormat.TextColor = Color.DarkRed;
Section section = document.AddSection();
Paragraph para = section.AddParagraph();
para.ApplyStyle(pStyle);
para.AppendText("Hello world!");
Style firstParaStyle = document.FirstSection.Body.FirstParagraph.Format.Style;
document.SaveToFile(outputDocxFile1, FileFormat.Docx);
document.Styles[pStyleName].RemoveSelf();
document.SaveToFile(outputDocxFile2, FileFormat.Docx);
|
| New feature | - | Enables conditional table formatting via TableConditionalStyle, TableConditionalStyleCollection, and TableConditionalStyleType to style odd/even rows and columns.
Document doc = new Document();
Section section = doc.AddSection();
Table table = section.AddTable();
table.ResetCells(15, 4);
for (int i = 0; i < 15; i++)
{
TableRow row = table.Rows[i];
for (int j = 0; j < 4; j++)
{
TableCell cell = row.Cells[j];
cell.AddParagraph().AppendText(string.Format("{0} column.", (j % 2 == 0 ? "Even" : "Odd")));
cell.AddParagraph().AppendText(string.Format("Row banding {0}", (i % 3 == 0 ? "start" : "continuation")));
}
}
TableStyle tableStyle = (TableStyle)doc.Styles.Add(StyleType.TableStyle, "TestTableStyle1");
tableStyle.Borders.Color = Color.Black;
tableStyle.Borders.BorderType = BorderStyle.Double;
tableStyle.RowStripe = 3;
tableStyle.ConditionalStyles[TableConditionalStyleType.OddRowStripe].Shading.BackgroundPatternColor = Color.LightBlue;
tableStyle.ConditionalStyles[TableConditionalStyleType.EvenRowStripe].Shading.BackgroundPatternColor = Color.LightCyan;
tableStyle.ColumnStripe = 1;
tableStyle.ConditionalStyles[TableConditionalStyleType.EvenColumnStripe].Shading.BackgroundPatternColor = Color.LightPink;
table.ApplyStyle(tableStyle);
table.Format.StyleOptions = table.Format.StyleOptions | TableStyleOptions.ColumnStripe;
doc.SaveToFile(outputDocxFile1, FileFormat.Docx);
|
| New feature | - | Obsoletes the Table.TableStyleName and replaces it with Table.Format.StyleName. Adds Table.Format.Style and Table.ApplyStyle(ITableStyle) for applying styles to tables. |
| New feature | SPIREDOC-3647 | Exposes Style, StyleOptions, and StyleName properties in TableFormat, with TableStyleOptions enum support.
Document doc = new Document();
Section section = doc.AddSection();
TableStyle tableStyle = (TableStyle)doc.Styles.Add(StyleType.TableStyle, "TestTableStyle1");
tableStyle.HorizontalAlignment = RowAlignment.Center;
tableStyle.Borders.Color = Color.Blue;
tableStyle.Borders.BorderType = BorderStyle.Single;
Table table = section.AddTable();
table.ResetCells(1, 1);
table.Rows[0].Cells[0].AddParagraph().AppendText("Aligned to the center of the page");
table.PreferredWidth = PreferredWidth.FromPoints(300);
table.ApplyStyle(tableStyle);
section.AddParagraph().AppendText(" ");
tableStyle = (TableStyle)doc.Styles.Add(StyleType.TableStyle, "TestTableStyle2");
tableStyle.LeftIndent = 55;
tableStyle.Borders.Color = Color.Green;
tableStyle.Borders.BorderType = BorderStyle.Single;
table = section.AddTable();
table.ResetCells(1, 1);
table.Rows[0].Cells[0].AddParagraph().AppendText("Aligned according to left indent");
table.PreferredWidth = PreferredWidth.FromPoints(300);
table.Format.Style = tableStyle;
doc.SaveToFile(outputDocxFile1, FileFormat.Docx);
|
| New feature | - | Adds Document.AddStyle(DefaultTableStyle) method to apply built-in table styles.
Document doc = new Document();
Section section = doc.AddSection();
Table table = section.AddTable();
table.ResetCells(15, 4);
for (int i = 0; i < 15; i++)
{
TableRow row = table.Rows[i];
for (int j = 0; j < 4; j++)
{
TableCell cell = row.Cells[j];
cell.AddParagraph().AppendText(string.Format("{0} column.", (j % 2 == 0 ? "Even" : "Odd")));
cell.AddParagraph().AppendText(string.Format("Row banding {0}", (i % 2 == 0 ? "Even" : "Odd")));
}
}
TableStyle tableStyle = doc.AddStyle(DefaultTableStyle.LightListAccent3);
table.ApplyStyle(tableStyle);
doc.SaveToFile(outputDocxFile1, FileFormat.Docx);
|
| New feature | - | Adds public classes PdfDigitalSignatureHashAlgorithm, PdfDigitalSignatureInfo, and PdfDigitalSignatureTimestampConfiguration to enable adding digital signatures and timestamps when saving PDF documents.
Document sDoc = new Document();
sDoc.LoadFromFile(inputFile);
ToPdfParameterList toPdfParameter = new ToPdfParameterList();
toPdfParameter.DigitalSignatureInfo = new PdfDigitalSignatureInfo(pfxInputFile, pfxPassword, "Test signing", "Spire Doc");
toPdfParameter.DigitalSignatureInfo.HashAlgorithm = PdfDigitalSignatureHashAlgorithm.RipeMD160;
toPdfParameter.DigitalSignatureInfo.SignatureDate = nowDateTime;
toPdfParameter.DigitalSignatureInfo.TimestampConfiguration = new PdfDigitalSignatureTimestampConfiguration("https://freetsa.org/tsr", "bill", "Password");
sDoc.SaveToFile(outputFile3, toPdfParameter);
|
| New feature | SPIREDOC-11376 | The Bookmark object now exposes FirstColumn and LastColumn properties, supporting retrieval of the column where a bookmark starts and where it ends.
int firstColumn = doc.Bookmarks["t_insert"].FirstColumn; int lastColumn = doc.Bookmarks["t_insert"].LastColumn; |
| New feature | SPIREDOC-11445 | Adds the SearchOptions class, supporting the option to ignore or include OfficeMath formula text during text replacement.
SearchOptions op = new SearchOptions();
op.IgnoreOfficeMath = false;
doc.Replace("ab","new", op);
|
| New feature | SPIREDOC-11452 | Adds the PageLayout property to support setting page layout when converting to PDF. The enumeration types are as follows: Default: Does not write a value; displayed according to the PDF reader's default view. SinglePage: Single page view. OneColumn: Continuous single-page view. TwoColumnLeft: Continuous two-page view, odd-numbered pages on the left. TwoColumnRight: Continuous two-page view, odd-numbered pages on the right. TwoPageLeft: Two-page view, odd-numbered pages on the left. TwoPageRight: Two-page view, odd-numbered pages on the right.
Document doc = new Document("xx.docx");
ToPdfParameterList toPdf = new ToPdfParameterList(){ PageLayout = PdfPageLayout.TwoColumnLeft };
doc.SaveToFile("xx.pdf", toPdf);
|
| Bug | SPIREDOC-10022 | Fixes incorrect parsing of LaTeX formulas. |
| Bug | SPIREDOC-10885 | Fixes inconsistent table styles when converting Word to PDF. |
| Bug | SPIREDOC-10992 | Fixes header images being obscured when converting Word to PDF. |
| Bug | SPIREDOC-11018 | Fixes incorrect text positioning when converting Word to PDF. |
| Bug | SPIREDOC-11041 | Fixes incorrect paragraph indentation when converting Word to PDF. |
| Bug | SPIREDOC-11129 | Fixes table content shifting when converting Word to PDF. |
| Bug | SPIREDOC-11184 SPIREDOC-11391 | Fixes inconsistent table styles when converting Word to PDF. |
| Bug | SPIREDOC-11384 | Fixes extra blank pages appearing when converting Word to PDF. |
| Bug | SPIREDOC-11423 | Fixes System.NullReferenceException thrown when converting Word to PDF. |
| Bug | SPIREDOC-11438 | Fixes ArgumentOutOfRangeException thrown when loading a Word document. |
| Bug | SPIREDOC-11512 | Fixes incorrect page count retrieval. |
Spre.XLS
| Category | ID | Description |
| Optimization | SPIREXLS-5888 | Optimizes the time consumption for converting Excel to PDF. |
| Optimization | SPIREXLS-5929 | Optimizes the time consumption for converting Excel to HTML. |
| New feature | SPIREXLS-4316 | Adds IXlsEquation Interface to support creating and modifying Equations.
Workbook workbook = new Workbook();
workbook.LoadFromFile("Equation_1.xlsx");
Worksheet sheet = workbook.Worksheets[0];
// Add a new equation at position (1, 1) with size 50x50, displaying fraction A/B
sheet.Equations.AddEquation(1, 1, 50, 50, "\\frac{A}{B}");
// Get the first equation in the worksheet
IXlsEquation equation = sheet.Equations[0];
// Update the equation content using LaTeX syntax
equation.UpdateByLatexText("\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha}");
// Set the position and size of the equation
equation.Top = 19;
equation.Left = 72;
equation.Width = 100;
equation.Height = 100;
// Get the second equation in the worksheet
IXlsEquation equation1 = sheet.Equations[1];
// Get the collection of equation items (components of the formula)
IEquationItemCollection equationItems = equation1.EquationItems;
// Get the first item in the collection
IEquationItem item1 = equationItems[0];
item1.Text = "e-iceblue"; // Modify the text of the item
// Append a new LaTeX formula at the end
equationItems.AddByLatex("\\frac{n!}{r!(n-r)!} ");
// Insert a LaTeX formula at index 0
equationItems.InsertByLatex(0, "\\Delta A B C");
// Save the workbook
workbook.SaveToFile("out.xlsx");
|
| New feature | SPIREXLS-5934 | Supports preserving frozen rows when converting Excel to HTML.
HTMLOptions.Default.IsSaveFreezedPanes = true; // true to preserve freeze panes, false to discard |
| New feature | SPIREXLS-5935 | Supports the ISOMITTED function.
sheet.Range["D7"].Formula = "=LAMBDA(val,max,IF(ISOMITTED(max),val,IF(AND(val>0,val<max),\"within range\",\"out of range\")))(A1,A2)"; |
| New feature | SPIREXLS-5941 | Supports the LAMBDA function.
sheet.Range["D5"].Formula = "=LAMBDA(a,b,IF(ISOMITTED(b),a*a,a*b))(A1,A2)"; |
| Bug | SPIREXLS-5856 | Fixes the issue where row height was retrieved incorrectly. |
| Bug | SPIREXLS-5904 | Fixes the issue where text boxes were missing when converting Excel to PDF. |
| Bug | SPIREXLS-5907 | Fixes the issue where text alignment in text boxes was incorrect when converting Excel to PDF. |
| Bug | SPIREXLS-5910 | Fixes the issue where data was incorrect when converting Excel to PDF. |
| Bug | SPIREXLS-5915 | Fixes the issue where content was incorrect when converting Excel to PDF. |
| Bug | SPIREXLS-5926 | Fixes the issue where rendering was incorrect when converting Excel to PDF. |
| Bug | SPIREXLS-5932 | Fixes the issue where borders were incorrect when converting Excel to PDF. |
| Bug | SPIREXLS-5940 | Fixes the issue that copying a worksheet containing a Slicer to another workbook threw a "System.ArgumentOutOfRangeException" exception. |
| Bug | SPIREXLS-5947 | Enhances compatibility handling for NamedRanges that contain error values. |
| Bug | SPIREXLS-5953 | Fixes the issue where chart formatting was incorrect when converting Excel to images. |
Spire.Presentation
| Category | ID | Description |
| Bug | SPIREPPT-3008 | Fixed an issue where documents failed to open when using netstandard libraries on .NET 9.0. |
| Bug | SPIREPPT-2976 | Fixes the issue of accidentally creating a new slide when inserting an SVG into a specified shape in a multi-page PowerPoint presentation. |
Spire.PDF
| Category | ID | Description |
| New feature | SPIREPDF-7617 | Adds the SaveAsImage(int pageIndex, int dpiX, int dpiY) method in the NETStandard DLL to support customizing image DPI when converting PDF to images. |
| New feature | SPIREPDF-7694 | Adds the Collate property in the NETStandard DLL to support setting the print order for multiple copies.
// true: Collated printing; default false: Uncollated printing doc.PrintSettings.Collate = true; |
| Bug | SPIREPDF-1134 | Fixes the issue where the text order was incorrect when rendering mixed Hebrew and English strings. |
| Bug | SPIREPDF-2641 SPIREPDF-4108 | Fixes the issue where Arabic text displayed incorrectly in TextBox form fields. |
| Bug | SPIREPDF-5073 | Fixes the issue where extra characters appeared when extracted text was redrawn. |
| Bug | SPIREPDF-7219 SPIREPDF-7261 | Fixes the issue where Arabic text was rendered incorrectly. |
| Bug | SPIREPDF-7647 | Fixes the issue where lines became thicker after converting OFD to PDF. |
| Bug | SPIREPDF-7685 | Fixes the issue where the application threw an exception when extracting text from pages. |
| Bug | SPIREPDF-7718 | Fixes the issue where printing PDF documents failed when calling the .NET Standard DLL. |
| Bug | SPIREPDF-6584 | Fixed an issue where memory consumption was high when using the NETStandard DLL to convert PDF to images. |
| Bug | SPIREPDF-7072 | Fixed an issue where the retrieved font name was inaccurate when searching for text. |
| Bug | SPIREPDF-7371 | Fixed an issue where the conversion result from OFD to PDF was incorrect. |
| Bug | SPIREPDF-7373 | Fixed an issue where annotations were not displayed when converting PDF to XPS. |
| Bug | SPIREPDF-7658 | Fixed an issue where the application threw an "Unexpected token before 158586" exception when loading a PDF document. |
| Bug | SPIREPDF-7669 | Fixed an issue where the application threw an "ArgumentOutOfRangeException" when extracting text. |
| Bug | SPIREPDF-7684 | Fixed an issue where the application threw an "Unknown annotation type value: 'Free Text'" exception when converting OFD to PDF. |
| Bug | SPIREPDF-7706 | Fixed an issue where some fonts could not be embedded correctly after drawing text. |
Spire.DocViewer
| Adjustment | - | Removed the "System.Security.Cryptography.Pkcs", "System.Security.Permissions", and "System.Security.Cryptography.Xml" dependencies. |
| Adjustment | - | Introduced a platform-agnostic .NET 7.0 version that supports running on all operating systems. |
| Adjustment | - | Introduced platform-specific versions for .NET 7.0-Android33.0 and .NET 7.0-Windows10.0.19041, which are deeply optimized for their respective platforms. |
Spire.PDFViewer
| New feature | - | Added a platform-agnostic .NET 7.0 version that runs across all operating systems. |
| Adjustment | - | Enhanced the platform-specific version for .NET 7.0-Windows 10.0.19041. |
Spire.Barcode
| Adjustment | - | Removed the“System.Security.Cryptography.Pkcs”, “System.Security.Permissions”, and “System.Security.Cryptography.Xml” dependencies on .NET Core and .NET Standard platforms. |
| Bug | SPIREBARCODE-285 | Fixed the issue where specific fonts could not be recognized when creating barcodes. |