Spire.Office 8.5.3 is released

2023-05-25 06:02:43

We are excited to announce the release of Spire.Office 8.5.3. In this version, Spire.Doc supports adding charts; Spire.XLS supports ISO.CEILING, WORKDAY.INTL, and EVALUATE functions; Spire.PDF optimizes the function of compressing PDF documents. Besides, a lot of known issues are successfully fixed 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.Email, Spire.DocViewer, Spire.PDFViewer, Spire.Spreadsheet, Spire.OfficeViewer, Spire.DataExport, Spire.Barcode are included.

DLL Versions:

  • Spire.Doc.dll v11.5.6
  • Spire.Pdf.dll v9.5.4
  • Spire.XLS.dll v13.5.1
  • Spire.Presentation.dll v8.4.1
  • Spire.Email.dll v6.5.7
  • Spire.DocViewer.Forms.dll v8.5.1
  • Spire.PdfViewer.Forms.dll v8.5.0
  • Spire.PdfViewer.Asp.dll v8.5.0
  • Spire.Spreadsheet.dll v7.4.2
  • Spire.OfficeViewer.Forms.dll v8.5.3
  • Spire.Barcode.dll v7.2.1
  • Spire.DataExport.dll v4.8.0
  • Spire.DataExport.ResourceMgr.dll v2.1.0
Click the link to get the version Spire.Office 8.5.3:
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 adding charts.
//Create word document
Document document = new Document();

//Create a new section
Section section = document.AddSection();

//Create a new paragraph and append text
section.AddParagraph().AppendText("Column chart.");

//Create a new section to append column chart
Paragraph newPara = section.AddParagraph();
ShapeObject shape = newPara.AppendChart(ChartType.Column, 500, 300);

//Clear the chart's series data to start with a clean chart.
Chart chart = shape.Chart;
chart.Series.Clear();

//Add a custom series to the chart with categories for the X-axis, and large respective numeric values for the Y-axis. 
chart.Series.Add("Test Series",
    new[] { "Word", "PDF", "Excel", "GoogleDocs", "Office" },
    new double[] { 1900000, 850000, 2100000, 600000, 1500000 });

//Set the number format of the Y-axis tick labels to group digits with commas. 
chart.AxisY.NumberFormat.FormatCode = "#,##0";

//Save the result file.
document.SaveToFile("AppendColumnChart.docx", FileFormat.Docx);
//Create word document
Document document = new Document();

//Create a new section
Section section = document.AddSection();

//Create a new paragraph and append text
section.AddParagraph().AppendText("Bubble chart.");

//Create a new paragraph and appen bubble chart
Paragraph newPara = section.AddParagraph();
ShapeObject shape = newPara.AppendChart(ChartType.Bubble, 500, 300);

//Clear char's series data to start with a clean chart
Chart chart = shape.Chart;
chart.Series.Clear();

//Add a custom series with X/Y coordinates and diameter of each bubbles. 
ChartSeries series = chart.Series.Add("Test Series",
    new[] { 2.9, 3.5, 1.1, 4.0, 4.0 },
    new[] { 1.9, 8.5, 2.1, 6.0, 1.5 },
    new[] { 9.0, 4.5, 2.5, 8.0, 5.0 });

//Save doc file.
document.SaveToFile("AppendBubbleChart.docx", FileFormat.Docx);
//Create word document
Document document = new Document();

//Create a new section
Section section = document.AddSection();

//Create a new paragraph and append text
section.AddParagraph().AppendText("Line chart.");

//Create a new paragraph to append line chart
Paragraph newPara = section.AddParagraph();
ShapeObject shape = newPara.AppendChart(ChartType.Line, 500, 300);

//Clear series data of line chart to start with a clean chart   
Chart chart = shape.Chart;
ChartTitle title = chart.Title;
title.Text = "My Chart";
ChartSeriesCollection seriesColl = chart.Series;
seriesColl.Clear();

//Set new data to chart
string[] categories = { "C1", "C2", "C3", "C4", "C5", "C6" };
seriesColl.Add("AW Series 1", categories, new double[] { 1, 2, 2.5, 4, 5, 6 });
seriesColl.Add("AW Series 2", categories, new double[] { 2, 3, 3.5, 6, 6.5, 7 });

//Save doc file.
document.SaveToFile("AppendLineChart.docx", FileFormat.Docx);
//Create a word document
Document document = new Document();

//Create a new section
Section section = document.AddSection();

//Create a new paragraph and append text
section.AddParagraph().AppendText("Pie chart.");

//Create a new paragraph to append pie chart
Paragraph newPara = section.AddParagraph();
ShapeObject shape = newPara.AppendChart(ChartType.Pie, 500, 300);
Chart chart = shape.Chart;

//Insert a custom chart series with a category name for each sectors and their frequency value.
ChartSeries series = chart.Series.Add("Test Series",
  new[] { "Word", "PDF", "Excel" },
  new[] { 2.7, 3.2, 0.8 });

//Save to a docx file.
document.SaveToFile("AppendPieChart.docx", FileFormat.Docx);
//Create word document
Document document = new Document();

//Create a new section
Section section = document.AddSection();

//Create a new paragraph and append text
section.AddParagraph().AppendText("Scatter chart.");

//Create a new paragraph to append scatter chart
Paragraph newPara = section.AddParagraph();
ShapeObject shape = newPara.AppendChart(ChartType.Scatter, 450, 300);
Chart chart = shape.Chart;

//Clear the chart's series data to start with a clean chart.
chart.Series.Clear();

//Insert a series with X/Y coordinates for five points.
chart.Series.Add("Scatter chart",
    new[] { 1.0, 2.0, 3.0, 4.0, 5.0 },
    new[] { 1.0, 20.0, 40.0, 80.0, 160.0 });

//Save to a docx file.
document.SaveToFile("AppendScatterChart.docx", FileFormat.Docx);
//Create word document
Document document = new Document();

//Create a new section
Section section = document.AddSection();

//Create a new paragraph and append text
section.AddParagraph().AppendText("Surface3D chart.");

//Create a new paragraph to append surface 3D chart
Paragraph newPara = section.AddParagraph();
ShapeObject shape = newPara.AppendChart(ChartType.Surface3D, 500, 300);

//Clear its series data to start with a clean chart
Chart chart = shape.Chart;
chart.Series.Clear();


chart.Title.Text = "My chart";

//Add three series
chart.Series.Add("Series 1",
    new string[] { "Word", "PDF", "Excel", "GoogleDocs", "Office" },
    new double[] { 1900000, 850000, 2100000, 600000, 1500000 });

chart.Series.Add("Series 2",
    new string[] { "Word", "PDF", "Excel", "GoogleDocs", "Office" },
    new double[] { 900000, 50000, 1100000, 400000, 2500000 });

chart.Series.Add("Series 3",
    new string[] { "Word", "PDF", "Excel", "GoogleDocs", "Office" },
    new double[] { 500000, 820000, 1500000, 400000, 100000 });

//Save to a docx file.
document.SaveToFile("AppendSurface3DChart.docx", FileFormat.Docx);
//Create word document
Document document = new Document();

//Create a new section
Section section = document.AddSection();

//Create a new paragraph and append text
section.AddParagraph().AppendText("Bar chart.");

//Create a new paragraph to append bar chart
Paragraph newPara = section.AddParagraph();
ShapeObject chartShape = newPara.AppendChart(ChartType.Bar, 400, 300);
Chart chart = chartShape.Chart;

//Use the "Title" property to give bar chart a title, which appears at the top center of the chart area.
ChartTitle title = chart.Title;
title.Text = "My Chart";

//Set the "Show" property to "true" to make the title visible. 
title.Show = true;

//Set the "Overlay" property to "true". Give other chart elements more room by allowing them to overlap the title
title.Overlay = true;

//Save to docx file.
document.SaveToFile("AppendBarChart.docx", FileFormat.Docx);
New feature - Supports adding SVG documents.
Document document = new Document();
Section section = document.AddSection();
string svgFile = "sample.svg";
Paragraph para = section.AddParagraph();
DocPicture svgPicture = para.AppendPicture(svgFile);
svgPicture.Width = 200;
svgPicture.Height = 200;
String DocxResult = "Result-AddSvg.docx";
document.SaveToFile(DocxResult, FileFormat.Docx2016);
New feature - Supports printing multiple pages onto one page.
doc.LoadFromFile(inputFile, FileFormat.Docx);
System.Windows.Forms.PrintDialog printDialog = new System.Windows.Forms.PrintDialog();
printDialog.PrinterSettings.PrintToFile = true;
printDialog.PrinterSettings.PrintFileName = "sample-new-4.xps";
doc.PrintDialog = printDialog;
doc.PrintMultipageToOneSheet(PagesPreSheet.FourPages, true);
New feature - Support manipulating pages, such as retrieving page content and its coordinates.
Document doc = new Document();
doc.LoadFromFile(inputFile, FileFormat.Docx);
FixedLayoutDocument layoutDoc = new FixedLayoutDocument(doc);

// Access to the line of the first page and print to the console.
FixedLayoutLine line = layoutDoc.Pages[0].Columns[0].Lines[0];

StringBuilder stringBuilder = new StringBuilder();
stringBuilder.AppendLine("Line: " + line.Text);

// With a rendered line, the original paragraph in the document object model can be returned.
Paragraph para = line.Paragraph;
stringBuilder.AppendLine("Paragraph text: " + para.Text);

// Retrieve all the text that appears on the first page in plain text format (including headers and footers).
string pageText = layoutDoc.Pages[0].Text;
stringBuilder.AppendLine(pageText);

// Loop through each page in the document and print the count of the lines appear on each page.
foreach (FixedLayoutPage page in layoutDoc.Pages)
{
    LayoutCollection lines = page.GetChildEntities(LayoutElementType.Line, true);
    stringBuilder.AppendLine("Page " + page.PageIndex + " has " + lines.Count + " lines.");
}

// This method provides a reverse lookup of layout entities for any given node
// (except runs and nodes in the header and footer).
stringBuilder.AppendLine("The lines of the first paragraph:");
foreach (FixedLayoutLine paragraphLine in layoutDoc.GetLayoutEntitiesOfNode(
    ((Section)doc.FirstChild).Body.Paragraphs[0]))
{
    stringBuilder.AppendLine(paragraphLine.Text.Trim());
    stringBuilder.AppendLine(paragraphLine.Rectangle.ToString());
}
File.WriteAllText("page.txt", stringBuilder.ToString());

Spire.XLS

Category ID Description
New feature SPIREXLS-4561 Supports ISO.CEILING function.
Workbook workbook = new Workbook();
workbook.Worksheets[0].Range["A1"].Formula = "ISO.CEILING(12.69,2)";
workbook.CalculateAllValue();
workbook.SaveToFile("result.xlsx",ExcelVersion.Version2016);
New feature SPIREXLS-4564 Supports WORKDAY.INTL function.
Workbook workbook = new Workbook();
workbook.Worksheets[0].Range["A1"].Formula = "=WORKDAY.INTL(DATE(2023,3,17),25,1,DATE(2023,3,20))";
workbook.CalculateAllValue();
workbook.SaveToFile("result.xlsx",ExcelVersion.Version2016);
New feature SPIREXLS-4608 Supports EVALUATE function in WPS.
Bug SPIREXLS-4568 Fixed the issue that System.ArgumentException exception was thrown in concurrent conversion of worksheets to HTML program.
Bug SPIREXLS-4575 Fixed the issue that when filling some cells with color, other cells are also filled.
Bug SPIREXLS-4599 Fixed the issue that it failed to copy some cells.
Bug SPIREXLS-4600 Fixed the issue that System.OutOfMemoryException exception was thrown when converting Excel to HTML.
Bug SPIREXLS-4607 Fixed the issue that System.IndexOutOfRangeException exception was thrown when loading Excel files.
Bug SPIREXLS-4613 Fixed the issue that function area of the menu bar was incorrect after saving the document.
Bug SPIREXLS-4626 Fixed the issue that many blank columns were generated after deleting hidden rows.
Bug SPIREXLS-4627 Fixed the issue that the content was incorrect when using .Net Standard package to convert sheets to images.

Spire.PDF

Category ID Description
New feature SPIREPDF-5840 Optimizes the function of compressing PDF documents.
PdfCompressor compressor = new PdfCompressor("input.pdf");
compressor.Options.TextCompressionOptions.UnembedFonts = true;
compressor.Options.ImageCompressionOptions.CompressImage = true;
compressor.Options.ImageCompressionOptions.ResizeImages = true;
compressor.Options.ImageCompressionOptions.ImageQuality = ImageQuality.Low;
compressor.CompressToFile("output.pdf");
Bug SPIREPDF-5170 Fixes the issue that inserting html code containing <ul> tags, etc. did not take effect.
Bug SPIREPDF-5601 Fixes the issue that the result document failed to open with Adobe tools after copying pdf pages.
Bug SPIREPDF-5883 Fixes the issue that text wrapping was incorrect after converting PDF to Word.
Bug SPIREPDF-5897 Fixes the issue that spaces between words disappeared after converting PDF to images.
Bug SPIREPDF-5903 Fixes the issue that highlighting text failed.
Bug SPIREPDF-5923 Fixes the issue that null pointer exceptions occurred when saving flattened form fields.
Bug SPIREPDF-5938 Fixes the issue that annotations were lost after printing PDF files with annotations.
Bug SPIREPDF-5939 Fixes the issue that table extraction results were incorrect.
Bug SPIREPDF-5950 Fixes the issue that System.InvalidOperationException exceptions occurred when converting PDF to OFD.
Bug SPIREPDF-5951 Fixes the issue that extracted text exceeded the table boundaries.
Bug SPIREPDF-5952 Fixes the issue that setting the width with PdfAnnotationBorder border = new PdfAnnotationBorder() {Width = 20f} did not work.
Bug SPIREPDF-5968 Fixes the issue that filling XFA Form fields failed.
Bug SPIREPDF-5970 Fixes the issue that System.ArgumentException exceptions occurred when converting OFD to PDF.

Spire.Email

Category ID Description
Bug SPIREEMAIL-76 Fixes the issue that it was failed to connect to Imap server and Pop3 server when used in the NetFramework application.