We're pleased to announce the release of Spire.Office 11.11.1. This version adds several new features. For example, Spire.XLS adds support for TSV-to-PDF conversion; Spire.Presentation supports printing slides with notes; Spire.PDF adds support for PDF form fields and XFA forms; In addition, a series of issues that occurred when processing Word, Excel, PDF, and 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.Barocde: 7.5.13
- Spire.Doc: 14.11.5
- Spire.DocViewer: 8.11.1
- Spire.Email: 6.8.0
- Spire.OfficeViewer: 9.1.1
- Spire.PDF: 12.11.5
- Spire.PDFViewer: 8.3.4
- Spire.Presentation: 11.11.1
- Spire.Spreadsheet: 7.5.3
- Spire.XLS: 16.10.3
Here is a list of changes made in this release
Spire.Doc
| Category | ID | Description |
| Bug Fix | SPIREDOC-12051 | Fixed the issue where the character count was retrieved incorrectly. |
| Bug Fix | SPIREDOC-12082 | Fixed the issue where header images were displayed incompletely when converting Word to PDF. |
| Bug Fix | SPIREDOC-12094 | Fixed the issue where tables were incorrectly positioned when converting Word to PDF. |
| Bug Fix | SPIREDOC-12122 | Fixed the issue where a "StackOverflowException" was thrown during Word to PDF conversion. |
Spire.XLS
| Category | ID | Description |
| New Feature | SPIREXLS-6225 | Added support for parsing .tsv files and converting them to PDF.
Workbook workbook = new Workbook();
workbook.LoadFromFile(inputFile, "\t");
workbook.SaveToFile(outputFile, FileFormat.PDF);
workbook.Dispose();
|
| Adjustment | - | Updated the .NET Core packaging and dependencies for .NET 6.0, .NET 9.0, and .NET 10.0 to improve cross-platform compatibility by following the .NET Standard specifications. Image processing has been migrated from System.Drawing to SkiaSharp. Other platforms remain unchanged. |
| Bug Fix | SPIREXLS-6223 | Fixed an issue with incorrect updated formula calculation values when converting Excel to PDF. |
| Bug Fix | SPIREXLS-6224 | Fixed an issue where string values in date columns were exported as empty when using ExportDataTable. |
.NET Core Packaging and Image Processing Changes
The dependencies for .NET 6.0, .NET 9.0, and .NET 10.0 have been updated as follows.
The dependencies listed here are minimum versions.
| Dependency | .NET 6.0 | .NET 9.0 | .NET 10.0 |
| SkiaSharp | ≥ 3.116.1 | ≥ 3.116.1 | ≥ 3.116.1 |
| Microsoft.Win32.Registry | ≥ 5.0.0 | ≥ 5.0.0 | ≥ 5.0.0 |
| System.Buffers | ≥ 4.5.1 | ≥ 4.5.1 | ≥ 4.5.1 |
| System.Memory | ≥ 4.5.5 | ≥ 4.5.5 | ≥ 4.5.5 |
| System.Text.Encoding.CodePages | ≥ 6.0.0 | ≥ 9.0.0 | ≥ 10.0.0 |
| HarfBuzzSharp | ≥ 8.3.0.1 | ≥ 8.3.0.1 | ≥ 8.3.0.1 |
Image Export Code Migration
When exporting a worksheet to an image, the returned value is now a Stream. The image stream can be copied to a file instead of calling Save() directly on the result.
- Previous code using System.Drawing:
- Updated code using SkiaSharp-based image processing:
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"in.xlsx");
Worksheet sheet = workbook.Worksheets[0];
sheet.ToImage(sheet.FirstRow, sheet.FirstColumn, sheet.LastRow, sheet.LastColumn).Save("SheetToImage.png");
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"in.xlsx");
Worksheet sheet = workbook.Worksheets[0];
Stream image = sheet.ToImage(sheet.FirstRow, sheet.FirstColumn, sheet.LastRow, sheet.LastColumn);
string filename = String.Format("SheetToImage.png");
FileStream fileStream = new FileStream(filename, FileMode.Create, FileAccess.Write);
image.CopyTo(fileStream, 100);
fileStream.Flush();
fileStream.Close();
image.Close();
Spire.Presentation
| Category | ID | Description |
| New Feature | SPIREPPT-3124 | Adds support for printing slides with notes.
Presentation ppt = new Presentation(); ppt.LoadFromFile(inputFile); PresentationPrintDocument document = new PresentationPrintDocument(ppt); document.PrintSlidesWithNotes = true; document.PrinterSettings.PrintToFile = true; document.PrinterSettings.PrintFileName = outputFile; ppt.Print(document); |
| Adjustment | - | Adjusts .NET Core packaging and dependencies for .NET 6.0, .NET 9.0, and .NET 10.0 by achieving cross-platform compatibility through .NET Standard specifications and migrating image processing from System.Drawing to SkiaSharp. |
| Bug Fix | SPIREPPT-2675 | Fixes the issue where loading a PPTX document with comments threw the "Comment by nonexistent author" error. |
| Bug Fix | SPIREPPT-3177 | Fixes the issue where color blocks were not displayed when converting PPT to PDF. |
| Bug Fix | SPIREPPT-3199 | Fixes the issue where saving a PPTX document as PPSX threw the "Object reference not set to an instance of an object" error. |
| Bug Fix | SPIREPPT-3207 | Fixes the issue where loading a certain PPTX document threw the "Object reference not set to an instance of an object" error. |
| Bug Fix | SPIREPPT-3210 | Fixed an issue where shape colors were incorrect when converting PowerPoint documents to PDF. |
| Bug Fix | SPIREPPT-3214 | Fixed an issue where content was lost when converting PowerPoint documents to PDF. |
| Bug Fix | SPIREPPT-3215 | Fixed an issue where an extra border appeared when converting shapes to SVG. |
| Bug Fix | SPIREPPT-3216 | Fixed an issue where custom properties of PowerPoint documents were retrieved incorrectly. |
.NET Core Packaging and Image Processing Changes
The dependencies for .NET 6.0, .NET 9.0, and .NET 10.0 have been updated as follows.
The dependencies listed here are minimum versions.
| Dependency | .NET 6.0 | .NET 9.0 | .NET 10.0 |
| SkiaSharp | ≥ 3.116.1 | ≥ 3.116.1 | ≥ 3.116.1 |
| Microsoft.Win32.Registry | ≥ 5.0.0 | ≥ 5.0.0 | ≥ 5.0.0 |
| System.Buffers | ≥ 4.5.1 | ≥ 4.5.1 | ≥ 4.5.1 |
| System.Memory | ≥ 4.5.5 | ≥ 4.5.5 | ≥ 4.5.5 |
| System.Text.Encoding.CodePages | ≥ 6.0.0 | ≥ 9.0.0 | ≥ 10.0.0 |
| HarfBuzzSharp | ≥ 8.3.0.1 | ≥ 8.3.0.1 | ≥ 8.3.0.1 |
Spire.PDF
| Category | ID | Description |
| New Feature | - | Added the Spire.Pdf.Interactive.Forms namespace to support creating, reading, modifying, and flattening AcroForm fields. |
| New Feature | - | Added support for accessing and processing XFA forms through the Spire.Pdf.Interactive.Forms.Xfa namespace. |
| New Feature | - | Added support for importing and exporting PDF form data in XML, FDF, and XFDF formats through PdfForm. |
| Adjustment | - | Revised the .NET Core packaging approach. Cross-platform compatibility is realized by adhering to the .NET Standard specification. Dependencies in readme.txt were updated for .NET 6.0, .NET 9.0 and .NET 10.0 as listed below; all other platforms remain unchanged:
.NET 6.0 has external references to: SkiaSharp >= 3.116.1 Microsoft.Win32.Registry >= 5.0.0 System.Buffers >= 4.5.1 System.Memory >= 4.5.5 System.Text.Encoding.CodePages >= 6.0.0 HarfBuzzSharp >=8.3.0.1 .NET 9.0 has external references to: SkiaSharp >= 3.116.1 Microsoft.Win32.Registry >= 5.0.0 System.Buffers >= 4.5.1 System.Memory >= 4.5.5 System.Text.Encoding.CodePages >= 9.0.0 HarfBuzzSharp >=8.3.0.1 .NET 10.0 has external references to: SkiaSharp >= 3.116.1 Microsoft.Win32.Registry >= 5.0.0 System.Buffers >= 4.5.1 System.Memory >= 4.5.5 System.Text.Encoding.CodePages >= 10.0.0 HarfBuzzSharp >=8.3.0.1 For .NET 6.0, .NET 9.0 and .NET 10.0, the image processing logic has been migrated from System.Drawing to SkiaSharp, with relevant code modifications as follows: Original implementation using System.Drawing: using (Image image = doc.SaveAsImage )
{ image.Save(fileName, System.Drawing.Imaging.ImageFormat.Png); }
New implementation using SkiaSharp: using (var image = doc.SaveAsImage )
{ string filename = String.Format(outputFile + i + ".png");
System.IO.FileStream fileStream = new
System.IO.FileStream(fileName,
System.IO.FileMode.Create, System.IO.FileAccess.Write);
image.CopyTo(fileStream); fileStream.Flush(); }
|
| Optimization | - | Deprecated the `AppendPage` interface for merging PDFs; use the following new methods instead:
MergeOptions option= new MergeOptions();
PdfMerger.Merge(new string[] { file1, file2, file2, file2 }, output, option);
|
| Optimization | - | The namespace Spire.Pdf.Multiimedia._3DArtwork has been renamed to Spire.Pdf.Multiimedia.Artwork3D. |
| Optimization | - | The type of the XfaNumericField.Value property has been changed from decimal to double. |
| Bug Fix | SPIREPDF-6951 | Fixed the issue where links in the document were lost after merging documents and then adding content (annotations or text). |
| Bug Fix | SPIREPDF-7961 | Fixed the issue where an out-of-memory error "System.OutOfMemoryException" was thrown when converting OFD to PDF. |
| Bug Fix | SPIREPDF-8147 | Fixed the issue where the font size of rotated text became smaller after converting PDF to Excel. |
| Bug Fix | SPIREPDF-8155 | Fixed the issue where the extracted text was duplicated when extracting text by a rectangle area. |
| Bug Fix | SPIREPDF-8167 | Fixed the issue where images disappeared when zooming in Adobe Reader after converting XPS to PDF. |
| Bug Fix | SPIREPDF-4317 | Fixed the issue where the digital certificate was obtained as null. |
| Bug Fix | SPIREPDF-5703 | Fixed the issue where form fields and styles on later pages were lost after merging multiple PDF documents. |
| Bug Fix | SPIREPDF-7237 | Fixed the issue where underlines were offset from the text when converting PDF to Word. |
| Bug Fix | SPIREPDF-7400 | Fixed the issue where, when filling XFA form fields, only the first field could be filled and the remaining fields stayed empty. |
| Bug Fix | SPIREPDF-7947 | Fixed the issue where verification of the first signature failed when a PDF document contained multiple signatures. |
| Bug Fix | SPIREPDF-8181 | Fixed the issue where an "NullReferenceException" error was thrown when loading a PDF document. |
| Bug Fix | SPIREPDF-6282 | Fixed an issue where some XFA form fields failed to be filled. |
| Bug Fix | SPIREPDF-6661 | Fixed an issue where fonts changed when converting PDF to Word. |
| Bug Fix | SPIREPDF-6708 | Fixed an issue where some content was lost when printing PDF files. |
| Bug Fix | SPIREPDF-6867 | Fixed an issue where the generated file could not be opened after converting PDF to Word. |
1. Added the Spire.Pdf.Interactive.Forms namespace
The new Spire.Pdf.Interactive.Forms namespace provides a unified and comprehensive API for creating, reading, modifying, and flattening PDF form fields. It covers the common AcroForm field types, with the following key properties and methods.
Supported AcroForm Field Types
| Field Type | Property / Method | Description |
| Text field PdfTextField | IsMultiline | Whether multi-line input is allowed |
| IsPassword | Displayed as a mask (password field) | |
| MaxLen | Maximum number of characters allowed | |
| IsComb | Uses character comb cells | |
| DoNotSpellCheck | Disables spell checking | |
| Text | The text content of the field | |
| Font | Field font | |
| Check box PdfCheckBoxField | IsChecked | Whether it is currently checked |
| OnValue | Export value for the checked state | |
| Style | Visual style (Check/Circle/Cross/Diamond/Square/Star) | |
| Radio button PdfRadioButtonField | Options | Collection of export values for the options |
| SelectedIndex | Index of the currently selected option | |
| SelectedValue | Export value of the currently selected option | |
| NoToggleToOff | Whether deselecting is disabled once selected | |
| AddOption() | Adds a new radio option to the page | |
| Combo box PdfComboBoxField | Items | Collection of drop-down options |
| IsMultiSelect | Whether multiple selection is allowed | |
| SelectedIndex | Index of the currently selected option | |
| SelectedValue | Export value of the currently selected option | |
| CascadeTo() | Establishes a JavaScript cascade with another combo box | |
| List box PdfListBoxField | Items | Collection of list options |
| IsMultiSelect | Whether multiple selection is allowed | |
| TopIndex | Index of the first visible list option | |
| SelectedIndices | Collection of indices of the selected options | |
| SelectedValues | Collection of export values of the selected options | |
| Push button PdfPushButtonField | Text / RolloverText / DownText | Button text for the normal / rollover / down states |
| Icon / RolloverIcon / DownIcon | Display icons for the corresponding three states | |
| Layout | Layout of the icon and text | |
| Action | Action executed when the button is clicked | |
| Signature field PdfSignatureField | Signature | Digital signature object associated with the field |
In addition to the field-specific members listed above, all fields inherit common properties from PdfField, including:
- IsReadOnly: Specifies whether the field is read-only.
- IsRequired: Specifies whether the field is required.
- AlternateName: Gets or sets the alternate name of the field.
- MappingName: Gets or sets the mapping name of the field.
- DefaultAppearance: Gets or sets the default appearance of the field.
All fields can also call Flatten() to flatten the form field into static page content.
2. Extended Support for XFA Forms
This version also introduces access to XFA forms through the Spire.Pdf.Interactive.Forms.Xfa sub-namespace. Developers can retrieve XFA form field names and objects, inspect field values, and work with a variety of XFA field types.
Supported AcroForm Field Types
| Field Type | Property / Method | Description |
| XFA form XfaForm | FieldNames | List of field names in the form template |
| XfaFields | List of field objects in the form template | |
| Count | Number of form fields | |
| GetField(name) | Gets an XFA field by name | |
| CheckFieldExists(name) | Checks whether the specified field exists | |
| Text XfaTextField | Value | Text value of the field |
| Numeric XfaNumericField | Format | Numeric format string |
| Value | Field value (decimal) | |
| Check box XfaCheckBoxField | IsChecked | Whether it is currently checked |
| Radio button XfaRadioButtonField | Options | List of export values for the options |
| SelectedIndex | Index of the currently selected option | |
| SelectedValue | Export value of the currently selected option | |
| NoToggleOff | Whether deselecting is disabled once selected | |
| Choice list XfaChoiceField | Items | List of available items (display values) |
| IsMultiSelect | Whether multiple selection is supported | |
| SelectedItem | Currently selected single item | |
| SelectedItems | List of currently selected items | |
| Date/time XfaDateTimeField | Value | Date/time value of the field |
| Image XfaImageField | Image | Image of the field (Stream / Image) |
| Barcode XfaBarcodeField | Value | Barcode value |
| Length | Barcode length | |
| StartChar | Barcode start character | |
| EndChar | Barcode end character |
All XFA fields inherit common properties from XfaField, including:
- Name: The field name.
- XfaForm: The containing XFA form.
- FieldType: The field type identifier.
The XfaSignatureField (signature) and XfaPushButtonField (push button) classes do not define additional public properties and are accessed primarily through their inherited common members.
3. Added Form Data Import and Export
PdfForm now supports importing and exporting form data in XML, FDF, and XFDF formats. This functionality facilitates form data exchange between PDF documents, business systems, and third-party PDF tools.
Code example:
using System.Drawing;
using System.Collections.Generic;
using Spire.Pdf;
using Spire.Pdf.Graphics;
using Spire.Pdf.Interactive.Forms;
PdfDocument doc = new PdfDocument();
PdfPageBase page = doc.Pages.Add();
// Get the form container via PdfForm.Create() under the new namespace
PdfForm form = PdfForm.Create(doc);
// Create a text field and add it to the page
PdfTextField nameField = new PdfTextField(form, "Address.Street");
nameField.DefaultAppearance = new PdfDefaultAppearance(
new PdfFont(PdfFontFamily.Helvetica, 12), new PdfRGBColor(0, 0, 0));
nameField.AddWidget(page, new RectangleF(100, 100, 250, 30));
nameField.Value = "123 Main St";
// Retrieve fields by name and by prefix
PdfField field = form.GetField("Address.Street");
List<PdfField> addressFields = form.Fields.FindByPrefix("Address");
// Flatten to static content and save
form.Flatten();
doc.SaveToFile("output.pdf");
Form data can also be exchanged directly in formats such as XFDF:
// Export form data as XFDF and import it back from the file
form.ExportData("form.xfdf", DataFormat.XFDF, "PurchaseOrder");
form.ImportData("form.xfdf", DataFormat.XFDF);
Spire.PDFViewer
| Category | ID | Description |
| Adjustment | - | For Spire.PdfViewer.Forms.dll in the NET6.0 folder, the dependency on System.Drawing.Common >= 6.0.0 has been replaced with SkiaSharp >= 3.116.1. |