Spire.Office for .NET is a combination of Enterprise-Level Office .NET API offered by E-iceblue. It includes Spire.Doc, Spire.XLS, Spire.Spreadsheet, Spire.Presentation, Spire.PDF, Spire.DataExport, Spire.OfficeViewer, Spire.PDFViewer, Spire.DocViewer, Spire.Barcode and Spire.Email. Spire.Office contains the most up-to-date versions of the above .NET API.

With Spire.Office for .NET, developers can create a wide range of applications. It enables developers to open, create, modify, convert, print, View MS Word, Excel, PowerPoint and PDF documents. Furthermore, it allows users to export data to popular files such as MS Word/Excel/RTF/Access, PowerPoint, PDF, XPS, HTML, XML, Text, CSV, DBF, Clipboard, SYLK, PostScript, PCL, etc.

Spire.Office for .NET can be linked into any type of a 32-bit or 64-bit .NET application including ASP.NET, Web Services and WinForms for .NET Framework version 2.0 to 4.5. Spire.Office also supports to work on .NET Core, .NET 5.0, .NET 6.0, .NET 8.0,.NET 9.0, .NET 10.0, Microsoft Azure, Mono Android and Xamarin.iOS.

Here is a list of changes made in this release

Spre.doc

Category ID Description
New feature SPIREDOC-3929 Added support for configuring formula conversion to MathML when converting Word to HTML.
HtmlExportOptions options = doc.HtmlExportOptions;
options.OfficeMathOutputMode = HtmlOfficeMathOutputMode.MathML;
New feature SPIREDOC-9868 Added support for deleting specified pages and blank pages.
doc.RemoveBlankPages(); // Delete blank pages
doc.RemovePages(new List {0,1,3}); // Delete specified pages
New feature SPIREDOC-11489 Added support for creating and manipulating VBA macros.
Document doc = new Document();
doc.AddSection().AddParagraph().AppendText("wertyuiop[]fghjk");

// Add VBA project to document
VbaProject vbaProject = new VbaProject();
vbaProject.Name = "SampleVBAMacro";
doc.VbaProject = vbaProject;

// Add modules to VBA project
// Module 1
VbaModule vbaModule1 = doc.VbaProject.Modules.Add("SampleModule1", VbaModuleType.StdModule);
vbaModule1.SourceCode = @"
Sub DocumnetInfo()
    MsgBox ""create time: "" &Now()
    MsgBox ""Pages:"" & ActiveDocument.Range.ComputeStatistics(wdStatisticPages)
End Sub

Sub WriteHello()
    Selection.TypeText Text:=""Hello World!""
End Sub";

// Module 2
VbaModule vbaModule2 = doc.VbaProject.Modules.Add("SampleModule2", VbaModuleType.StdModule);
vbaModule2.SourceCode = @"
Sub InsertCurrentDate()
    Selection.TypeText Text:=Format(Now(),""yyyy-mm-dd hh:mm:ss"")
End Sub

Sub IndentParagraph()
    Selection.ParagraphFormat.LeftIndent = InchesToPoints(0.5)
End Sub";

doc.SaveToFile("result.docm", FileFormat.Docm);
doc.Close();
New feature SPIREDOC-11598 Added GetRevisionInfos() method to retrieve full revision information from the document.
Document doc = new Document();
doc.LoadFromFile("input.docx");
StringBuilder sb = new StringBuilder();
RevisionInfoCollection revisionInfoCollection = doc.GetRevisionInfos();

foreach (RevisionInfo revisionInfo in revisionInfoCollection)
{
    sb.AppendLine("[author]:" + revisionInfo.Author + "\r\n" + "  [RevisionType]:" + revisionInfo.RevisionType + "\r\n" + "  [DateTime]:" + revisionInfo.DateTime.ToString() + "\r\n" + "  [OwnerObject]:" + revisionInfo.OwnerObject + "\r\n" + "  [OwnerObject.Owner]:" + revisionInfo.OwnerObject.Owner + "\r\n");
    if (revisionInfo.OwnerObject is TextRange textRange)
    {
        TextRange range = (TextRange)textRange;
        sb.AppendLine($"TextRange - Content:{range.Text}");
    }
}
File.WriteAllText(outputFile, sb.ToString());
doc.Dispose();
Bug SPIREDOC-11523 Fixed the issue where the program hangs when converting Word to PDF.
Bug SPIREDOC-11632 Fixed the issue where line breaks are incorrect when adding multi-line watermarks.
Bug SPIREDOC-11692 Fixed the issue where table of contents fields fail to update.
Bug SPIREDOC-11703 Fixed the issue where the result is incorrect when converting Markdown to Word.
Bug SPIREDOC-11706 Fixed the issue where document saving takes a long time when adding multi-line text with "\r\n".
Bug SPIREDOC-11727 Fixed the issue where extra blank paragraphs appear when adding HTML to Word.
Bug SPIREDOC-11744 Fixed the issue where images are blurry when converting Word to HTML.
Bug SPIREDOC-11767 Fixed the issue where content is inconsistent when loading and saving RTF files.
Bug SPIREDOC-10843 Fixed the issue where the program hung for a long time when using new FixedLayoutDocument(document).
Bug SPIREDOC-11532 Fixed the issue where the program hung for a long time when converting Word documents to PDF.
Bug SPIREDOC-11758 Fixed the issue where an incorrect numbering format was returned when retrieving lists.
Bug SPIREDOC-11728 SPIREDOC-11730 SPIREDOC-11731 Fixed the issue where incorrect content was generated when converting Word documents to PDF.

Spre.XLS

Category ID Description
New feature SPIREXLS-5948 Added support for the BYROW and BYCOL functions.
// Use BYROW to calculate the average of each row
sheet.Range["G2"].Formula = "=BYROW(B2:F2, LAMBDA(row, AVERAGE(row)))";
// Use BYCOL to calculate the average of each column
sheet.Range["B8"].Formula = "=BYCOL(B2:B7, LAMBDA(col, AVERAGE(col)))";
New feature SPIREXLS-5980 Added support for converting a specified cell range to HTML.
Workbook workbook = new Workbook();
workbook.LoadFromFile(inputFile);
Worksheet sheet = workbook.Worksheets[0];
CellRange cell = sheet.Range["A1:B3"];
string html = cell.HtmlString;
File.WriteAllText(outputFile, html);
New feature SPIREXLS-5983 Added support for transposing rows and columns when copying a cell range.
CopyRangeOptions options = CopyRangeOptions.Transpose | CopyRangeOptions.All;
sheet["A1:C4"].Copy(sheet["D2:G3"], options);
sheet["A1:B5"].Copy(sheet["D5"], options);
workbook.SaveToFile(outputFile);
New feature SPIREXLS-6018 Added support for converting Excel files to PDF/UA-compliant documents.
Workbook workbook = new Workbook();
workbook.LoadFromFile(inputFile);
workbook.ConverterSetting.PdfConformanceLevel = Spire.Xls.Pdf.PdfConformanceLevel.Pdf_UA1;
workbook.SaveToFile(outputFile, FileFormat.PDF);
workbook.Dispose();
Bug SPIREXLS-6044 Fixed an issue where OLE objects in the document could not be deleted successfully.

Spire.Presentation

Category ID Description
New feature - Added support for highlighting text based on regular expression matches.
// Simple word matching
Regex regex = new Regex(@"\bhello\b");
IAutoShape shape = (IAutoShape)ppt.Slides[0].Shapes[0];
TextHighLightingOptions options = new TextHighLightingOptions();
shape.TextFrame.HighLightRegex(regex, Color.Red, options);
New feature SPIREPPT-3051 Fixed the issue where some content was lost during PPTX-to-PDF conversion.
Bug SPIREPPT-3058 Fixed the issue where the configured default font was not applied during PPTX-to-PDF conversion.

Spire.PDF

Category ID Description
New feature SPIREPDF-5365 Supports getting and setting the PDF 2.0 version.
// Retrieve
PdfFileInfo info = doc.FileInfo;
PdfVersion version = info.Version;

// Settings
doc.FileInfo.Version = PdfVersion.Version2_0;
Bug SPIREPDF-6905 Fixes the issue where text color was rendered incorrectly when converting PDF to images.
Bug SPIREPDF-7866 Fixes the issue where memory was not properly released during text replacement.
Bug SPIREPDF-7875 Fixes the issue where QR codes were missing after converting PDF to PDF/A or images.
Bug SPIREPDF-7884 Fixes the issue where an ArgumentOutOfRangeException was thrown when loading XPS files.
Bug SPIREPDF-7892 Fixes the issue where text extraction failed under certain conditions.
Bug SPIREPDF-7867 Fixes the issue where rendering effects were incorrect when converting PDF to Word.
Bug SPIREPDF-7097 Fixes the issue where content copied from the result document was incorrect after converting PDF to PDF/A-3B.
Bug SPIREPDF-7841 Fixes the page numbering style issue when using ChromeHtmlConverter to convert HTML to PDF for printing.
Bug SPIREPDF-7847 Fixes the issue where obtaining font properties of text box fields threw an "ArgumentOutOfRangeException".
Bug SPIREPDF-7888 Optimizes timestamp requests by reducing calls to timestamp servers and improving validation.
Logo

助力广东及东莞地区开发者,代码托管、在线学习与竞赛、技术交流与分享、资源共享、职业发展,成为松山湖开发者首选的工作与学习平台

更多推荐