Spire.Office 9.3.1 is released

2024-03-25 06:58:38

We are excited to announce the release of Spire.Office 9.3.1. In this version, Spire.Doc supports parsing GIF format content in Word documents; Spire.Presentation supports AI features and setting PPTX to SVG conversion options; Spire.DocViewer supports WPF and MAUI platforms; Spire.XLS supports PivotTable grouping functionality; Spire.PDFViewer supports obtaining the coordinates of a mouse click relative to the PDF page content. In additions, 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.Email, Spire.DocViewer, Spire.PDFViewer, Spire.Spreadsheet, Spire.OfficeViewer, Spire.DataExport, and Spire.Barcode are included.

DLL Versions:

  • Spire.Doc.dll v12.2.10
  • Spire.Pdf.dll v10.3.7
  • Spire.XLS.dll v14.3.3
  • Spire.Presentation.dll v9.3.4
  • Spire.Barcode.dll v7.2.9
  • Spire.Spreadsheet.dll v7.4.6
  • Spire.Email.dll v6.5.10
  • Spire.DocViewer.Forms.dll v8.7.8
  • Spire.PdfViewer.Forms.dll v7.12.11
  • Spire.PdfViewer.Asp.dll v7.12.11
  • Spire.OfficeViewer.Forms.dll v8.7.6
  • Spire.DataExport.dll v4.9.0
  • Spire.DataExport.ResourceMgr.dll v2.1.0
Click the link to get the version Spire.Office 9.3.1:
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 SPIREDOC-10052 Supports parsing GIF format content in Word documents.
Bug SPIREDOC-10154 Fixes the issue that incorrect bullets were retrieved.
Bug SPIREDOC-10160 Fixes the issue that GIF format was converted to PNG format after mail merge.
Bug SPIREDOC-10233 Fixes the issue that private font embedding failed when converting Word to PDF.
Bug SPIREDOC-10234 Fixes the issue that characters were incorrect when converting Word to PDF.
Bug SPIREDOC-10235 Fixes the issue that reading fonts failed when converting Word to PDF on MAC systems.
Bug SPIREDOC-10261 Fixes the issue that the program threw "System.NullReferenceException" exception when loading a Docx document.
Bug SPIREDOC-10295 Fixes the issue that the table would have extra borders after loading a Docx document and saving it as a new document.
Bug SPIREDOC-10305 Fixes the issue that the program threw "System.ArgumentException" exception when comparing two Word documents.
Bug SPIREDOC-10308 Fixes the issue that the program hung when getting page count.
Bug SPIREDOC-10318 Fixes the issue that the program threw "System.InvalidCastException" when comparing two Word documents.

Spire.XLS

Category ID Description
New feature SPIREXLS-765 Supports PivotTable grouping function.
XlsPivotTable pt = worksheet.PivotTables[0] as XlsPivotTable;
IPivotField field = pt.RowFields[0];
DateTime start = new DateTime(2024, 5, 6);
DateTime end = new DateTime(2024, 10, 6);
PivotGroupByTypes[] types = new PivotGroupByTypes[]{ PivotGroupByTypes.Days };
field.CreateGroup(start, end, types, 1);
New feature SPIREXLS-5091 Supports adding FindAll() method to CellRange.
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"test.xlsx");
Worksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].FindAll()
New feature SPIREXLS-5123 Supports setting "Repeat All Item Labels" for PivotTable.
foreach (XlsPivotTable pt in wb.Worksheets["PivotTable"].PivotTables)
 {
 pt.Options.RepeatAllItemLabels = true; 
 }
Bug SPIREXLS-5097 Fixes the issue that the content was incorrect after saving Excel files.
Bug SPIREXLS-5103 Fixes the issue that the sheet content exported using ExportDataTable was incorrect.
Bug SPIREXLS-5105 Fixes the issue that formula values were incorrect when converting Excel to PDF.
Bug SPIREXLS-5106 Fixes the issue that the program threw "Size of image is too large" exception when converting Excel to images.
Bug SPIREXLS-5110 Fixes the issue that the PivotTable column names were inconsistent when converting Excel to pictures.
Bug SPIREXLS-5122 Fixes the issue that there were some extra blank comments in result files after using CellRange.Comment.Text.
Bug SPIREXLS-5125 Fixes the issue that the styles were incorrect when converting Excel to PDF.
Bug SPIREXLS-5126 Fixes the issue that the program threw "ArgumentNullException" exception when loading files.
Bug SPIREXLS-5148 Fixed the issue that the program threw "NullReferenceException" exception when splitting a document.

Spire.PDF

Category ID Description
Bug SPIREPDF-6423 Optimizes the high memory consumption when converting multiple TIFF to PDF.
Bug SPIREPDF-6515 Fixes the issue that the application threw a "System.NullReferenceException" when printing PDF documents.
Bug SPIREPDF-6516 Fixes the issue that some content remained in color when converting PDF documents to grayscale.
Bug SPIREPDF-6528 Fixes the issue that the application threw a "System.NullReferenceException" when using the split() method.
Bug SPIREPDF-6531 Fixes the issue that the application threw a "System.IndexOutOfRangeException" when extracting text.
Bug SPIREPDF-6547 Fixes the issue that the results of searching for highlighted text were incorrect.
Bug SPIREPDF-6549 Fixes the issue that the application threw an exception when using PdfCode39Barcode to generate barcodes for data with "*"
Bug SPIREPDF-6550 Fixes the issue that the digital signature verification result was incorrect.
Bug SPIREPDF-6555 Fixes the issue that spaces disappeared after converting PDF documents to PPT.
Bug SPIREPDF-6558 Fixes the issue that the application threw an "Empty convert-string" exception when saving PDF documents.
Bug SPIREPDF-6568 Fixes the issue that the application threw a "System.OverflowException" when loading PDF documents.
Bug SPIREPDF-6574 Fixes the issue that the application threw a "System.ArgumentException" when converting PDF to XPS.
Bug SPIREPDF-6575 Fixes the issue that the action JavaScript code of the form button field could not be obtained.

Spire.Presentation

New features and bug fixes:

Category ID Description
New feature SPIREPPT-2445 Support retrieving the default font styles of a PowerPoint document.
Presentation presentation = new Presentation();
presentation.LoadFromFile(inputFile);
IAutoShape shape = presentation.Slides[0].Shapes[0] as IAutoShape;
DefaultTextRangeProperties format = shape.TextFrame.Paragraphs[0].TextRanges[0].DisPlayFormat;
File.AppendAllText(outputFile, "text :" + shape.TextFrame.Paragraphs[0].TextRanges[0].Text + "\r\n");
File.AppendAllText(outputFile, "is bold :" + format.IsBold + "\r\n");
File.AppendAllText(outputFile, "is italic :" + format.IsItalic + "\r\n");
New feature SPIREPPT-2451 Adds SaveToSvgOption for settings PPTX to SVG conversion options.
Presentation ppt = new Presentation();
ppt.LoadFromFile(inputFile);
ppt.SaveToSvgOption.SaveUnderlineAsDecoration = true;
byte[] svgByte = ppt.Slides[0].Shapes[0].SaveAsSvgInSlide();
FileStream fs = new FileStream(outputFile + "1.svg", FileMode.Create);
fs.Write(svgByte, 0, svgByte.Length);
fs.Close();
New feature SPIREPPT-2459 Adds the showMasterShapes property to the ILayout class to display background shapes.
Presentation presentation = new Presentation();
presentation.LoadFromFile(@"in.pptx");
bool showMasterShape = presentation.Slides[1].Layout.ShowMasterShapes;
Bug SPIREPPT-2443 Fixes the issue that the gradient color was incorrect when converting PPTX to SVG.
Bug SPIREPPT-2452 Fixes the issue that the image quality degraded when converting PPTX to PDF.
Bug SPIREPPT-2453 Fixes the issue that the text space was lost when converting shape to SVG.
Bug SPIREPPT-2454 Fixes the issue that the content was incorrect when loading and saving PPTX documents.

AI functions and APIs:

Function API
Text polishing public string Polish(IShape shape,string language);
Translation public string Translate(ISlide slide, string language);
Summarization public string Summarize(IShape shape, string language);
Presentation generation public Presentation Generate(string describe, string language, bool genareteBackGroundImage);
Questioning public string Ask(string question, bool enableHistory = false);
Document search public string DocumentSearch(string question, string file_server_path, bool enableHistory = false);
Image generation public Stream ImageGenerate(string description);

Spire.DocViewer

Category Description
New feature Supports .NET 6.0, including WPF and Windows Form.
New feature Supports MAUI platform (.NET 7.0), currently only for Windows and Android.

Spire.PDFViewer

Category ID Description
New feature SPIREPDFVIEWER-454 Spire.PdfDocumentViewer supports obtaining the coordinates of a mouse click relative to the PDF page content.
private void Form1_Load(object sender, EventArgs e)
   {
	  this.pdfDocumentViewer1.LoadFromFile("1.pdf");
	  this.pdfDocumentViewer1.MouseDown += new MouseEventHandler(PV_Click);
	}

	private void PV_Click(object sender, MouseEventArgs e)
	{
		string outputFile = "out.Pdf";
		string outputFile_TXT = "out.txt";
		File.Delete(outputFile_TXT);           
	   if (e.Button == MouseButtons.Left) 
	   {
			PointF[] controlPositions = new PointF[] { e.Location};
			Spire.PdfViewer.Forms.PagePosition[] pagePositions = this.pdfDocumentViewer1.ControlToPage(controlPositions);                
string fileName = this.pdfDocumentViewer1.FileName;
			PdfDocument doc = new PdfDocument();
			doc.LoadFromFile(fileName,FileFormat.PDF);                
PdfPageBase page = doc.Pages[pagePositions[0].PageIndex];
		  
			RectangleF bounds = new RectangleF(pagePositions[0].Position, new SizeF(100, 100));            
			PdfTextExtractor textExtractor = new PdfTextExtractor(page);
			PdfTextExtractOptions option = new PdfTextExtractOptions();
			option.ExtractArea = bounds;
			string text = textExtractor.ExtractText(option);         
			PdfFont font = new PdfFont(PdfFontFamily.Helvetica, 11);
			PdfTextWidget pdfTextbox = new PdfTextWidget();
			pdfTextbox.Font = font;
			pdfTextbox.Brush = PdfBrushes.Red;
			pdfTextbox.Text = "stamp";                
pdfTextbox.Draw(page, bounds);                
doc.Pages[pagePositions[0].PageIndex].Canvas.DrawRectangle(PdfPens.Red, bounds);
			doc.SaveToFile(outputFile);               
File.AppendAllText(outputFile_TXT, "Position: " + pagePositions[0].Position.ToString() + "\ntext:\r\n " + text);                
MessageBox.Show("finish");               
doc.Dispose();
		}
	}