Spire.Office 10.5.0 is released

Spire.Office 10.5.0 is released

2025-05-29 08:04:00

We're pleased to announce the release of Spire.Office 10.5.0. This version adds many new features, for example, Spire.Doc supports writing MHTML format files; Spire.XLS supports detecting and deleting duplicate rows; Spire.PDF supports printing on Windows and Linux systems using .NET Standard DLL; Spire.Presentation supports inserting formulas in table cells. What’s more, a series of issues occurred when processing, converting Word/ Excel/ PDF/ PowerPoint files have been successfully fixed. More details are given below.

In this version, the most recent versions of Spire.Doc, Spire.PDF, Spire.XLS, Spire.Presentation, Spire.Email, Spire.DocViewer, Spire.PDFViewer, Spire.Spreadsheet, Spire.OfficeViewer, Spire.DataExport, Spire.Barcode are included.

DLL Versions:

  • Spire.Doc.dll: v13.5.11
  • Spire.Pdf.dll: v11.5.9
  • Spire.XLS.dll: v15.5.2
  • Spire.Presentation.dll: v10.5.10
  • Spire.Barcode.dll: v7.3.7
  • Spire.Email.dll: v6.6.3
  • Spire.DocViewer.Forms.dll: v8.8.4
  • Spire.PdfViewer.Asp.dll: v8.1.3
  • Spire.PdfViewer.Forms.dll: v8.1.3
  • 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
Click the link to get the version Spire.Office 10.5.0:
More information of Spire.Office new release or hotfix:

Here is a list of changes made in this release

Spire.Doc

Category ID Description
New feature - Supports writing MHTML format files.
Adjustment - Upgrades the version of HarfBuzzSharp and SkiaSharp on Net (net4.6, 4.8), NetCore, and NetStandard platforms.

HarfBuzzSharp -> 8.3.0.1, SkiaSharp -> 3.116.1
Adjustment - Optimized the waiting time for downloading images from a Uri. The Netstandard reference adjustment is as follows:

<PackageReference Include="HarfBuzzSharp" Version="8.3.0.1" />
<PackageReference Include="SkiaSharp" Version="3.116.1" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.5.0" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="4.5.0" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="4.7.1" />
<PackageReference Include="System.Security.Permissions" Version="4.5.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0" />
Adjustment - Adds DLL for .NET 9.0 Framework and removes DLL for .NET 7.0 Framework.

System.Drawing.Common >= 9.0.0
System.Security.Permissions >= 9.0.0
System.Text.Encoding.CodePages >= 9.0.0
System.Security.Cryptography.Pkcs >= 9.0.0
System.Security.Cryptography.Xml >= 9.0.0
HarfBuzzSharp >=8.3.0.1
Bug SPIREDOC-10409 Fixes the issue that the text filled in merged cells would cause the merge to be lost.
Bug SPIREDOC-10867 Fixes the issue that the content was incorrect when converting Word documents to PDF documents.
Bug SPIREDOC-11072 Fixes the issue that the URL failed to display after converting MarkDown to Word.
Bug SPIREDOC-11081 Fixes the issue that the program threw the "InvalidOperationException" exception when converting Word to HTML stream.
Bug SPIREDOC-11081 Fixes the issue that the program threw the "Object reference not set to an instance of an object" exception when loading Word document.
Bug SPIREDOC-11094 Fixes the issue that the program threw the "NullReferenceException" exception when converting MarkDown to Word.
Bug SPIREDOC-10418
SPIREDOC-10762
Fixes the issue where inconsistent pagination occurred when converting Word to PDF.
Bug SPIREDOC-11177 Fixes the issue that font embedding was incorrect when converting Word to PDF.
Bug SPIREDOC-11220 Fixes the issue where the "Allow row to break across pages" setting was lost when loading saved documents.
Bug SPIREDOC-11230 Fixes the issue where the program threw "System.ArgumentException" when loading a Word document.
Bug SPIREDOC-11253 Fixes the issue where the values of content controls couldn't be modified.
Bug SPIREDOC-11260 Fixes the issue where the program threw "System.ArgumentException" when merging files.

Spire.XLS

Category ID Description
New feature SPIREXLS-5695 Supports the RANK.AVG formula.

workbook.Worksheets[0].Range["E9"].Formula = "=RANK.AVG(10,A1:A6)";
New feature SPIREXLS-5696 Supports the RANK.EQ formula.

//Default descending order
workbook.Worksheets[0].Range["E9"].Formula = "=RANK.EQ(10,A1:A6)";
New feature SPIREXLS-5722 Supports the PERCENTILE.INC formula.

workbook.Worksheets[0].Range["D2"].Formula = "=PERCENTILE.INC(\"\", 0.3)";
New feature SPIREXLS-5723 Supports the PERCENTILE.EXC formula.

workbook.Worksheets[0].Range["D2"].Formula = "=PERCENTILE.EXC(\"\", 0.3)";
New feature SPIREXLS-5729 Supports the BINOM.DIST formula.

workbook.Worksheets[0].Range["D2"].Formula = "=BINOM.DIST(A7, A11, A12, FALSE)";
New feature SPIREXLS-5730 Supports the BINOM.INV formula.

workbook.Worksheets[0].Range["D2"].Formula = "=BINOM.INV(A7, A12, A13)";
New feature SPIREXLS-5734 Supports the NEGBINOM.DIST formula.

workbook.Worksheets[0].Range["C10"].Formula = "=NEGBINOM.DIST(10,5,1,TRUE)";
New feature SPIREXLS-5738 Supports the BINOM.DIST.RANGE formula.

workbook.Worksheets[0].Range["C6"].Formula = "=BINOM.DIST.RANGE(10, 2, 5)";
New feature SPIREXLS-5739 Supports the BETA.DIST formula.

workbook.Worksheets[0].Range["C7"].Formula = "=BETA.DIST(3, 0, 5, TRUE, 1, 5)";
New feature SPIREXLS-5740 Supports the BETA.INV formula.

workbook.Worksheets[0].Range["C7"].Formula = "=BETA.INV(0.685470581, 8, -1, 1, 3)";
New feature SPIREXLS-5742 Supports the ROUNDBANK formula.

workbook.Worksheets[0].Range["B3"].Formula = "=ROUNDBANK(1245585, -1)";
New feature SPIREXLS-5743 Supports the GAMMA formula.

workbook.Worksheets[0].Range["B3"].Formula = "=GAMMA(ss)";
New feature SPIREXLS-5744 Supports the GAMMA.DIST formula.

workbook.Worksheets[0].Range["B10"].Formula = "=GAMMA.DIST(10.0001131, 9, 0, TRUE)";
New feature SPIREXLS-5745 Supports the GAMMA.INV formula.

workbook.Worksheets[0].Range["B10"].Formula = "=GAMMA.INV(0.068094, 0, 2)";
New feature SPIREXLS-5748 Supports the TAKE formula.

workbook.Worksheets[0].Range["J16"].Formula = "=TAKE(A1:F6,3)";
New feature SPIREXLS-5751 Supports the HSTACK formula.

workbook.Worksheets[0].Range["G26"].Formula = "=HSTACK(E1:F7,G1:G6)";
New feature SPIREXLS-5697 Supports auto-fitting row height in merged cells spanning multiple columns in a single row.

Workbook workbook = new Workbook();
workbook.LoadFromFile(@"in.xlsx");
Worksheet sheet= workbook.Worksheets[0];
AutoFitterOptions options = new AutoFitterOptions();
options.AutoFitMergedCells = true;
//the first parameter is the merged row
sheet.AutoFitRow(9, 1, sheet.LastColumn, options);
workbook.SaveToFile(@"out.xlsx", Spire.Xls.FileFormat.Version2016);
workbook.Dispose();
New feature SPIREXLS-5746 SPIREXLS-5768 SPIREXLS-5769 SPIREXLS-5774 Supports the GAMMALN.PRECISE, LOGNORM.INV, LOGNORM.DIST, and GAUSS formulas.

sheet.Range["C2"].Formula = "=GAUSS(A1)";
sheet.Range["C3"].Formula = "=LOGNORM.DIST(A2, A3, A4, A5)";
sheet.Range["C4"].Formula = "=GAMMALN.PRECISE(1.5)";
sheet.Range["C5"].Formula = "=LOGNORM.INV(0.5, 0, 1)";
New feature SPIREXLS-5787 Supports detecting and deleting duplicate rows.

// Remove duplicate rows in the worksheet
sheet.RemoveDuplicates();
// Remove duplicate rows within specified range
sheet.RemoveDuplicates(int startRow, int startColumn, int endRow, int endColumn);
// Remove duplicate rows based on specific columns and headers
sheet.RemoveDuplicates(int startRow, int startColumn, int endRow, int endColumn, boolean hasHeaders, int[] columnOffsets)
New feature SPIREXLS-5793 SPIREXLS-5797 SPIREXLS-5798 SPIREXLS-5801 Supports new functions (TRIMRANGE, ERF.PRECISE, ERFC.PRECISE, and PERMUTATIONA).

sheet.Range["A45"].Formula = "=TRIMRANGE(A1:H10, 1, 1)";
sheet.Range["B4"].Formula = "=ERF.PRECISE(1)";
sheet.Range["B4"].Formula = "=ERFC.PRECISE(NULL)";
sheet.Range["B9"].Formula = "=PERMUTATIONA(A5,A5)"
Bug SPIREXLS-5653 Fixes the issue where content was not fully displayed when converting Excel to PDF.
Bug SPIREXLS-5706 Fixes the issue where the program threw an "ArgumentOutOfRangeException" when loading Excel documents.
Bug SPIREXLS-5713 Fixes the issue where incorrect data was generated when converting Excel to PDF.
Bug SPIREXLS-5716 Fixes the issue where charts were incorrect when converting Excel to PDF.
Bug SPIREXLS-5719 Fixes the issue where content was stretched when converting Excel to PDF.
Bug SPIREXLS-5721 Fixes the issue where the structure protection password was lost when saving Excel documents.
Bug SPIREXLS-5735 Fixes the issue where setting FormatConditionType.ColorScale had no effect or produced incorrect results.
Bug SPIREXLS-5749 Improves behavior to prevent throwing "InvalidOperationException: Cannot find font installed on the system" when no fonts are available on the system.
Bug SPIREXLS-5555 Fixes the issue where data was incomplete when converting Excel to PDF with the SheetFitToPage=true property.
Bug SPIREXLS-5724 Fixes the inconsistency issue when converting Excel to PDF.
Bug SPIREXLS-5725 Fixes the issue where the text was displayed incorrectly when converting Excel to PDF.
Bug SPIREXLS-5767 Fixes the issue that the XML data for ColumnWidth did not comply with OpenXML standards.
Bug SPIREXLS-5775 Fixes the issue that it was where failed to update the associated sheets when modifying the row count in a sheet.
Bug SPIREXLS-5777 Fixes the issue where shapes were incorrect in the saved Excel file.
Bug SPIREXLS-5778 Fixed the issue that the IFERROR formula returned incorrect values.
Bug SPIREXLS-5785 Fixes the issue that getting the font of cell text was incorrect.
Bug SPIREXLS-5792 Fixes the issue that the sorting results were incorrect.
Bug SPIREXLS-5796 Fixes the issue that the program threw “ArgumentOutOfRangeExceltion” when loading an Excel document.

Spire.PDF

Category ID Description
New feature SPIREPDF-7372 Supports retrieving PdfHideAction in buttons.

//Initialize an instance of the PdfDocument instance
PdfDocument doc = new PdfDocument();

//Load a PDF document
doc.LoadFromFile(inputFile);

//Initialize an instance of the StringBuilder class
StringBuilder sb = new StringBuilder();

//Get the form from the document
PdfFormWidget formWidget = doc.Form as PdfFormWidget;

//Iterate through all fields in the form
for (int i = 0; i < formWidget.FieldsWidget.List.Count; i++)
{

    PdfField field = formWidget.FieldsWidget.List[i] as PdfField;

    //Get the ButtonField
    if (field is PdfButtonWidgetFieldWidget)
    {
        PdfButtonWidgetFieldWidget buttonField = field as PdfButtonWidgetFieldWidget;
        // Get the field name
        string filename = buttonField.Name;

        // Get the action
        PdfAction action = buttonField.Actions.MouseDown;
        if (buttonField.Actions.MouseDown != null && buttonField.Actions.MouseDown is PdfHideAction)
        {
            var btnAction = (PdfHideAction)buttonField.Actions.MouseDown;
            sb.AppendLine(filename + "-MouseDown-Hide-" + btnAction.IsHide.ToString());
            sb.AppendLine(filename + "-MouseDown-fname-" + btnAction.FieldName[0].ToString());
        }
    }
}
File.WriteAllText(outputFile, sb.ToString());
doc.Dispose();
New feature SPIREPDF-7376 SPIREPDF-7391 SPIREPDF-7467 Supports printing on Windows and Linux systems using .NET Standard DLL.

    PdfDocument doc = new PdfDocument();
    doc.LoadFromFile(pdffile);
    doc.PrintSettings.SelectPageRange(1, 5);
    if(doc.PrintSettings.CanDuplex)
    {
        doc.PrintSettings.Duplex = PdfDuplex.Vertical;
    }
   doc.Print();
Bug SPIREPDF-6717 Fixes the issue that removing the checkbox's background color and border did not take effect.
Bug SPIREPDF-7348 Fixes the issue that standards validation failed when converting PDF to A1A and A1B.
Bug SPIREPDF-7352 Fixes the issue that button field actions could not be obtained.
Bug SPIREPDF-7355 Fixes the issue that transparency was incorrect when setting background colors.
Bug SPIREPDF-7356 Fixes the issue that the number of annotations in a PDF document was not correctly retrieved.
Bug SPIREPDF-7358 Fixes the issue that extra content appeared when extracting text from PDF tables.
Bug SPIREPDF-7366 Fixes the issue that the program threw the exception System.NullReferenceException: "Object reference not set to an instance of an object." when getting the destination of bookmarks.
Bug SPIREPDF-7375 Fixes the issue that the multiline content added into textbox fields was being truncated.
Bug SPIREPDF-7361 Fixes the issue that adding PdfTextMarkupAnnotation produced incorrect effects.
Bug SPIREPDF-7380 Fixes the issue where the text was garbled when converting PDF to images.
Bug SPIREPDF-7388 Fixes the issue where the application threw the “NullReferenceException” when accessing PdfDocumentLinkAnnotationWidget.Destination.
Bug SPIREPDF-7414 Fixes the issue where the text was truncated when entering multi-line content into PdfTextBoxField.
Bug SPIREPDF-7420 Fixes the issue where the application threw the “PdfDocumentException” when using the PdfDocument.IsPasswordProtected() method.
Bug SPIREPDF-7424 Fixes the issue where the application threw the “ArgumentOutOfRangeException” when converting PDF to images.
Bug SPIREPDF-7426 Fixes the issue that the/DA structure was incorrect in TextBox fields.
Bug SPIREPDF-7429 Fixes the issue where the application threw the "Empty convert-string" error when saving PDF documents.
Bug SPIREPDF-7431 Fixes the issue where the result was incorrect when setting FieldsWidget.BorderColor = PdfRGBColor.Empty.
Bug SPIREPDF-7239 Fixes the issue that the characters of formulas were lost when converting PDF to XPS.
Bug SPIREPDF-7437 Fixes the issue that the program threw “Empty convert-string” error when saving PDF documents.
Bug SPIREPDF-7441 Fixes the issue that the program threw “IndexOutOfRangeException” error when converting PDF to PDFA3B.

Spire.Presentation

Category ID Description
New feature SPIREPPT-2772 Supports reading CustomerData of Shape.

Presentation ppt = new Presentation();
ppt.LoadFromFile(inputFile);
List dataList = ppt.Slides[0].Shapes[1].CustomerDataList;
Console.WriteLine(dataList.Count);
for(int i = 0; i < dataList.Count; i++)
{
   string name = dataList[i].Name;
   string content = dataList[i].XML;
    File.WriteAllText(outputFile + name, content);
}
New feature SPIREPPT-2782 Supports inserting formulas in table cells.

//Create a PPT document
Presentation presentation = new Presentation();


Double[] widths = new double[] { 100, 100, 150, 100, 100 };
Double[] heights = new double[] { 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 };

//Add new table to PPT
ITable table = presentation.Slides[0].Shapes.AppendTable(presentation.SlideSize.Size.Width / 2 - 275, 90, widths, heights);

String[,] dataStr = new String[,]{
{"Name",    "Capital",  "Continent",    "Area", "Population"},
{"Venezuela",   "Caracas",  "South America",    "912047",   "19700000"},
{"Bolivia", "La Paz",   "South America",    "1098575",  "7300000"},
{"Brazil",  "Brasilia", "South America",    "8511196",  "150400000"},
{"Canada",  "Ottawa",   "North America",    "9976147",  "26500000"},
{"Chile",   "Santiago", "South America",    "756943",   "13200000"},
{"Colombia",    "Bagota",   "South America",    "1138907",  "33000000"},
{"Cuba",    "Havana",   "North America",    "114524",   "10600000"},
{"Ecuador", "Quito",    "South America",    "455502",   "10600000"},
{"Paraguay",    "Asuncion","South America", "406576",   "4660000"},
{"Peru",    "Lima", "South America",    "1285215",  "21600000"},
{"Jamaica", "Kingston", "North America",    "11424",    "2500000"},
{"Mexico",  "Mexico City",  "North America",    "1967180",  "88600000"}
};

//Add data to table
for (int i = 0; i < 13; i++)
    for (int j = 0; j < 5; j++)
    {
        //Fill the table with data
        table[j, i].TextFrame.Text = dataStr[i, j];

        //Set the Font
        table[j, i].TextFrame.Paragraphs[0].TextRanges[0].LatinFont = new TextFont("Arial Narrow");
    }

//Set the alignment of the first row to Center
for (int i = 0; i < 5; i++)
{
    table[i, 0].TextFrame.Paragraphs[0].Alignment = TextAlignmentType.Center;
}
string latexMathCode = @"x^{2}+\sqrt{x^{2}+1}=2";
table[2, 3].TextFrame.Paragraphs.AddParagraphFromLatexMathCode(latexMathCode);
//Set the style of table
table.StylePreset = TableStylePreset.LightStyle3Accent1;

//Save the document
presentation.SaveToFile("Output.pptx", FileFormat.Pptx2010);
New feature - Adds a new method ‘AddFromSVGAsShape()’ to convert SVG files into shapes.

Presentation ppt = new Presentation();
ppt.Slides[0].Shapes.AddFromSVGAsShapes(file.FullName);
ppt.SaveToFile(fileName + ".pptx", FileFormat.Pptx2013);
ppt.Dispose();
Bug SPIREXLS-5749 Fixes the issue that converting PPT to SVG resulted in incorrect shapes.
Bug SPIREPPT-2663 Fixes the issue where modifying data in PPT charts resulted in incorrect output.
Bug SPIREPPT-2740 Fixes the issue that converting PPT to PDF rendered incorrectly.
Bug SPIREPPT-2751 Fixes the issue where loading a PPT document threw a "FormatException."
Bug SPIREPPT-2775 Fixes the issue that inserting HTML content into a PPT document rendered incorrectly.
Bug SPIREPPT-2421 Fixes the issue where the text was garbled when converting PowerPoint to PDF.
Bug SPIREPPT-2691 Fixes the issue that the application threw a "System.NullReferenceException" error when adding a GroupShape to a new PowerPoint file.
Bug SPIREPPT-2798 Fixes the issue where the text was lost when converting PowerPoint to PDF.
Bug SPIREPPT-2804 Fixes the issue where opening a file saved using the Presentation.GetStream() method would cause an error.
Bug SPIREPPT-2824 Fixes the issue where the position of shapes changed after using the Ungroup() method.
Bug SPIREPPT-2840 Fixes the issue that the application threw a "NullReferenceException" error when converting PowerPoint to SVG.
Bug SPIREPPT-2851 Fixes the issue where the shapes were incorrect when converting PowerPoint to SVG.
Bug SPIREPPT-2858 Fixes the issue that there was incorrect text content when converting a specific PPT document to PDF.
Bug SPIREPPT-2842 Fixes the issue where Microsoft Powerpoint displayed an error message when opening a PPT file that was directly loaded and saved.

Spire.PDFViewer

Category ID Description
Bug SPIREPDFVIEWER-592 Fixes the issue of incorrect preview of PDF content.
Bug SPIREPDFVIEWER-603 Fixes the issue of incorrect horizontal and vertical scrollbar effects.
Bug SPIREPDFVIEWER-606 Fixes the issue that the control threw “NullReferenceException” after setting the “Anchor” property.

Spire.DocViewer

Category ID Description
Adjustment - Upgrades the versions of HarfBuzzSharp and SkiaSharp on .NET (.NET 4.6 and 4.8) and .NET Core platforms.

HarfBuzzSharp->8.3.0.1、SkiaSharp->3.116.1

Spire.Barcode

Category ID Description
Adjustment - Adds a DLL adapted to .NET 9.0 Framework, and removes a DLL adapted to .NET 7.0 Framework.
Adjustment - Upgrading the version of HarfBuzzSharp and SkiaSharp on .NET (net4.6, 4.8), NetCore, and NetStandard platforms.

HarfBuzzSharp->8.3.0.1、SkiaSharp->3.116.1

The Netstandard reference adjustment is as follows:

<PackageReference Include="HarfBuzzSharp" Version="8.3.0.1" />
<PackageReference Include="SkiaSharp" Version="3.116.1" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.5.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.7.0" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="4.7.0" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="4.7.1" />
<PackageReference Include="System.Security.Permissions" Version="4.7.0" />

Spire.Email

Category ID Description
Adjustment - Adds DLL for .NET 9.0 Framework and removes DLL for .NET 7.0 Framework.
Adjustment - Upgrades the version of HarfBuzzSharp and SkiaSharp on Net (net4.6, 4.8), NetCore, and NetStandard platforms:

HarfBuzzSharp->8.3.0.1、SkiaSharp->3.116.1