Spire.PDF for C++ 12.10.7 Released with New Platform Support and Major API Changes
We're pleased to announce the release of Spire.PDF for C++ 12.10.7. This version adds support for several new platforms, including Win-ARM64, Linux-ARM64, and OHOS. Most importantly, it introduces major structural and API changes to fully align its functionality with the .NET version. This is not a hot-swappable patch release. Existing projects cannot be upgraded simply by replacing the library files; source code modifications and a full recompilation are required. Developers should review the changes carefully before upgrading.
Major API Changes
To fully align the functionality of Spire.PDF for C++ with the .NET version, this release introduces major structural changes to the product package. Existing projects cannot be upgraded simply by replacing the library files. Source code modifications and a full recompilation are required.
Here is a list of changes made in this release
| Category | ID | Description |
| Adjustment | - | Added support for the following platforms: win-arm64, linux-arm64, linux-musl-arm64, musl_x64, ohos-arm64-v8a, ohos-x86_64, osx-arm64, and osx-x64. |
| Adjustment | - | Removed the "Spire.Pdf.o.h" header file. The corresponding header files in their respective sub-namespaces must now be included instead.
Old version: #include "Spire.Pdf.o.h" using namespace Spire::Pdf; using namespace std; New version: #include <iostream> #include "Spire/Pdf/PdfDocument.h" #include "Spire/Pdf/PdfPageBase.h" #include "Spire/Pdf/PdfPageCollection.h" #include "Spire/Pdf/Graphics/PdfCanvas.h" #include "Spire/Pdf/Graphics/PdfFont.h" #include "Spire/Pdf/Graphics/PdfFontFamily.h" #include "Spire/Pdf/Graphics/PdfRGBColor.h" #include "Spire/Pdf/Graphics/PdfSolidBrush.h" using namespace Spire::Pdf; using namespace Spire::Pdf::Graphics; ....... |
| Adjustment | - | Changed wide-character strings to UTF-8 narrow-character strings.
Old version: intrusive_ptr<PdfFont> font = new PdfFont(PdfFontFamily::Helvetica, 20.f); intrusive_ptr<PdfRGBColor> color = new PdfRGBColor(Color::GetBlue()); intrusive_ptr<PdfSolidBrush> brush = new PdfSolidBrush(color); intrusive_ptr<PdfStringFormat> leftAlignment = new PdfStringFormat(PdfTextAlignment::Left, PdfVerticalAlignment::Middle); page->GetCanvas()->DrawString(L"Left!", font, brush, 0, 20, leftAlignment); New version: intrusive_ptr<PdfFont> font = new PdfFont(PdfFontFamily::Helvetica, 20.f);
intrusive_ptr<PdfRGBColor> color = new PdfRGBColor(Color::GetBlue());
intrusive_ptr<PdfSolidBrush> brush = new PdfSolidBrush(color);
intrusive_ptr<PdfStringFormat> leftAlignment = new PdfStringFormat(PdfTextAlignment::Left, PdfVerticalAlignment::Middle);
page->GetCanvas()->DrawString("Left!", font, brush, 0, 20, leftAlignment);
|
Spire.PDF 12.11.0 fixes PDF form, conversion, and printing issues
We’re pleased to announce the release of Spire.PDF 12.11.0. This version fixes several issues related to XFA form filling, PDF conversion, and printing, including failed form field filling, font changes during PDF-to-Word conversion, and content loss when printing PDF files. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| 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. |
Spire.Office for Java 11.10.0 is released
We are pleased to announce the release of Spire.Office for Java 11.10.0. This version introduces two key enhancements: Spire.PDF for Java now supports setting fonts during HTML-to-PDF conversion and converting a specified page range of a PDF to Word, while Spire.Presentation for Java now supports converting PowerPoint presentations to Markdown. In addition, several issues occurred in the conversion and processing of Word, Excel, PDF, and PowerPoint files have been successfully fixed. Full details are provided below.
Here is a list of changes made in this release
Spire.Doc for Java
| Category | ID | Description |
| Bug Fix | SPIREDOC-10471 | Fixed the issue where the converted PDF content did not match the original Word document. |
| Bug Fix | SPIREDOC-11959 SPIREDOC-12092 | Fixed the issue where page numbers were displayed incorrectly after updating the Word table of contents field. |
| Bug Fix | SPIREDOC-12025 | Fixed the issue where the document content was incorrect after accepting revisions. |
| Bug Fix | SPIREDOC-12055 | Fixed the issue where extra blank pages were generated when converting Word to PDF. |
| Bug Fix | SPIREDOC-12064 | Fixed the issue where caption numbers were not automatically updated after inserting a caption. |
| Bug Fix | SPIREDOC-12108 | Fixed the issue where memory was not released in a timely manner during Word to PDF conversion. |
| Bug Fix | SPIREDOC-12109 | Fixed the issue where comments were still retained after clearing them, causing the operation to fail. |
| Bug Fix | SPIREDOC-12114 | Fixed the issue where an OutOfMemoryError was thrown when replacing long text. |
Spire.XLS for Java
| Category | ID | Description |
| Bug Fix | SPIREXLS-6211 | Fixed an issue where the Excel to PDF conversion program always hung and the conversion failed. |
Spire.Presentation for Java
| Category | ID | Description |
| New Feature | SPIREPPT-2914 | Added support for converting PPT(X) to Markdown file format.
Presentation presentaion = new Presentation(); presentaion.loadFromFile(inputFile); presentaion.saveToFile(outputFile, FileFormat.Markdown); presentaion.dispose(); |
| Bug Fix | SPIREPPT-3200 | Fixed the issue where the layout of content was inconsistent after converting PPT(X) to PDF. |
Spire.PDF for Java
| Category | ID | Description |
| New Feature | SPIREPDF-8121 | Added support for setting fonts when converting HTML to PDF.
ConvertOptions options = new ConvertOptions();
options.setAllowedFonts(new String[] { "Times New Roman", "Arial" });
converter.convertToPdf(input, output, options);
|
| New Feature | SPIREPDF-8142 | Added the setTextPen(PdfPen) method to PdfGridCellContent.
PdfDocument doc = new PdfDocument();
PdfPageBase page = doc.getPages().add();
PdfGrid grid = new PdfGrid();
grid.getStyle().setCellSpacing(1.0f);
PdfGridRow row = grid.getRows().add();
grid.getColumns().add(2);
float width = (float) page.getCanvas().getClientSize().getWidth()-(grid.getColumns().getCount() + 1);
grid.getColumns().get(0).setWidth(width * 0.8f);
PdfGridCell pdfGridCell = row.getCells().get(0);
PdfGridCellStyle pdfGridStyle =new PdfGridCellStyle();
PdfPen pen = PdfPens.getGreen();
pdfGridStyle.setTextPen(pen);
pdfGridStyle.setTextBrush(PdfBrushes.getBlack());
Font font=new Font("方正仿宋_GBK", Font.PLAIN, 12);
PdfTrueTypeFont trueTypeFont = new PdfTrueTypeFont(font, true);
pdfGridStyle.setFont(trueTypeFont);
pdfGridCell.setStyle(pdfGridStyle);
pdfGridCell.setValue("Thank you for interest in Spire.PDF.");
PdfGridCellContentList lst = new PdfGridCellContentList();
PdfGridCellContent textAndStyle = new PdfGridCellContent();
textAndStyle.setText("Thank you for interest in Spire.PDF.");
textAndStyle.setFont(trueTypeFont);
textAndStyle.setPen(PdfPens.Green());
textAndStyle.setBrush(PdfBrushes.getGreen());
lst.getList().add(textAndStyle);
row.getCells().get(1).setValue(lst);
PdfLayoutResult result = grid.draw(page, new Point2D.Float(10, 100));
doc.saveToFile("result_Bold.pdf", FileFormat.PDF);
|
| New Feature | SPIREPDF-7439 | Supports converting specified PDF page ranges to Word.
PdfToWordConverter pdfToWordConverter = new PdfToWordConverter(inputPath); pdfToWordConverter.saveToDocx(0, 2, outputPath); |
| Bug Fix | SPIREPDF-7542 | Fixed an issue where spaces between words were lost when converting PDF to Word. |
| Bug Fix | SPIREPDF-7659 | Fixed an issue where chart data was lost when converting PDF to Word in flow layout mode. |
| Bug Fix | SPIREPDF-7955 | Fixed an issue where the conversion results were inaccurate when converting PDF to Word. |
| Bug Fix | SPIREPDF-8103 | Fixed an issue where font names had an extra prefix and bold formatting was lost when converting PDF to Word. |
| Bug Fix | SPIREPDF-8120 | Fixed an issue where formatting was incorrect when converting PDF to Word. |
| Bug Fix | SPIREPDF-8157 | Fixed an issue where a NoSuchMethodException was thrown when calling ImageReader.getImageMetadata. |
| Bug Fix | SPIREPDF-6805/SPIREPDF-6891 | Fixes the issue of layout errors when converting PDF to Word. |
| Bug Fix | SPIREPDF-6960 | Fixes the issue where spaces between words in table cells were lost when extracting table text. |
| Bug Fix | SPIREPDF-6980 | Fixes the issue where the color of the seal changed when converting PDF pages to images. |
Spire.PDF for Android via Java 10.8.7 Adds Support for SHA-256/SHA-512 Signatures and Conversion Progress Callbacks
We're pleased to announce the release of Spire.PDF for Android via Java 10.8.7. This version adds support for signing with certificates that use algorithms such as SHA-256 and SHA-512, as well as tracking conversion progress through progress callbacks. It also adjusts the namespace of OfdConverter. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | - | Added support for signing with certificates that use algorithms such as SHA-256/SHA-512.
PdfDocument doc = new PdfDocument();
//Load file from disk
doc.loadFromFile(inputFile);
// Load the X509 certificate for signature.
PdfPKCS7Formatter formatter = new PdfPKCS7Formatter(new PdfCertificate(inputFile_pfx, "e-iceblue"), false);
// Create an instance of PdfOrdinarySignatureMaker using the loaded document and certificate.
PdfOrdinarySignatureMaker signatureMaker = new PdfOrdinarySignatureMaker(doc, formatter);
// Create an instance of PdfCustomSignatureAppearance as the appearance for the signature.
IPdfSignatureAppearance signatureAppearance = new PdfCustomSignatureAppearance();
// Make the signature with a specified name and the custom appearance.
signatureMaker.makeSignature("Signature", signatureAppearance);
for (HashAlgorithmType hashAlg : HashAlgorithmType.values()) {
if ("SM3".equalsIgnoreCase(hashAlg.name()))
{
continue;
}
// Set the current hash algorithm
formatter.getProperties().setHashAlgorithm(hashAlg);
String filePath = outputFile + "AddImageSignature_" + hashAlg.name() + ".pdf";
doc.saveToFile(filePath, FileFormat.PDF);
}
doc.close();
}
public static class PdfCustomSignatureAppearance implements IPdfSignatureAppearance {
public void generate(PdfCanvas pdfCanvas) {
int fontSize = 10;
PdfTrueTypeFont font = new PdfTrueTypeFont("Arial", 0,10, true);
float lineHeight = fontSize;
pdfCanvas.drawString("AAAAAAAAAAA", font, PdfBrushes.getRed(), 0, 0);
pdfCanvas.drawImage(PdfImage.fromFile(ExStoragePath + "data/E-logo.png"), 20, 0);
}
}
|
| New Feature | - | Added support for obtaining conversion progress via progress callback when converting PDF to Word, OFD to PDF, etc.
// Register a progress notifier when saving a PDF document
PdfDocument pdf = new PdfDocument();
pdf.loadFromFile(inputFile);
pdf.registerProgressNotifier(new CustomProgressNotifier(outputFile_T));
pdf.saveToFile(outputFile, FileFormat.XPS);
pdf.dispose();
// Register a progress notifier when converting PDF to Word
PdfToWordConverter converter = new PdfToWordConverter(inputFile);
converter.registerProgressNotifier(new CustomProgressNotifier(outputFile_T));
converter.saveToDocx(outputFile);
// Register a progress notifier when converting OFD to PDF
OfdConverter ofdConverter = new OfdConverter(inputFile);
ofdConverter.registerProgressNotifier(new CustomProgressNotifier(outputFile_T));
ofdConverter.toPdf(outputFile);
// Custom progress notifier, receives the progress in percent
public class CustomProgressNotifier implements IProgressNotifier {
private String outputFile;
private StringBuilder str = new StringBuilder();
public CustomProgressNotifier(String outputFile) {
this.outputFile = outputFile;
}
@Override
public void notify(float progress) {
str.append("Progress: ").append(progress).append("%\n");
try {
Files.writeString(Paths.get(outputFile), str.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
| Adjustment | - | The namespace of OfdConverter has been adjusted from com.spire.pdf.conversion to com.spire.additions.Ofd. |
Spire.Doc 14.10.9 Released with Major API Changes, Chart Gap Width and Table Overlap Support
We're pleased to announce the release of Spire.Doc 14.10.9. This update supports setting the "Gap Width" option of the charts and the "Allow Overlap" option of Word tables. Most importantly, it introduces substantial breaking API changes. Developers should review the full API differences before upgrading and update their code where necessary.
Major API Changes
The following are only a few representative examples of the API changes in this release. There are many more changes beyond those listed here.
- ChildObjects has been moved from DocumentObject to CompositeDocumentObject.
- The return value of OwnerTextBody has been changed from Body to IBody, requiring an explicit cast.
- The Id of Permission has been changed from string to int.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | SPIREDOC-12110 | Added support for setting the "Gap Width" option of the charts.
Document doc = new Document();
Paragraph p = doc.AddSection().AddParagraph();
Chart chart = p.AppendChart(ChartType.Column, 400, 300).Chart;
chart.Series.GapWidth = 100;
doc.SaveToFile("xxx.docx");
|
| New Feature | SPIREDOC-4261 | Added support for setting the "Allow Overlap" option of Word tables.
Document doc = new Document(); doc.LoadFromFile(inputFile); Section section = doc.Sections[0]; Spire.Doc.Table table = section.Tables[0] as Spire.Doc.Table; table.Format.AllowOverlap=true; doc.SaveToFile(outputFile_docx, FileFormat.Docx); doc.Close(); |
| Bug Fix | SPIREDOC-12115 | Fixed the issue where the header was lost when converting Word to PDF. |
Spire.Presentation 11.10.4 supports printing slides with notes
We're pleased to announce the release of Spire.Presentation 11.10.4. This version supports printing slides with notes and adjusts .NET Core package dependencies (migrating image processing for .NET 6.0/9.0/10.0 to SkiaSharp). Meanwhile, some issues that occurred when loading PPTX documents, converting PPT to PDF, and saving PPTX as PPSX have also been successfully fixed. More details are listed below.
Here is a list of changes made in this release
| 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. |
.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.OCR 2.3.1 Supports PaddleOCR 6.0.0 Models on .NET Standard
Spire.OCR 2.3.1 focuses on improvements for the .NET Standard platform. This release adds support for PaddleOCR 6.0.0 models, which no longer require spire_ocrsystem.dll and are available in three sizes: Tiny, Small, and Medium. The new models also support cross-platform deployment without requiring separate model configurations for different operating systems.
Summary of Updates
| Category | Description |
| New Feature | Added support for PaddleOCR 6.0.0 ONNX models in Tiny, Small, and Medium sizes. Download links are provided below. |
| Cross-Platform Support | Enabled the new models to run across supported platforms without operating-system-specific model variants. |
| Dependency Updates | Adjusted the dependency requirements for .NET Standard projects, including updates to SkiaSharp, HarfBuzzSharp, and other packages. |
New Feature
Support for PaddleOCR 6.0.0 Models
Spire.OCR 2.3.1 supports PaddleOCR 6.0.0 ONNX models. Unlike the previous model configuration, the new models do not depend on spire_ocrsystem.dll.
Three model sizes are available to accommodate different deployment requirements:
- Tiny: For lightweight deployments.
- Small: For general-purpose use.
- Medium: For deployments that require a larger model.
The models support cross-platform use without requiring operating-system-specific model variants.
Model downloads:
- Direct download: PaddleOCR 6.0.0 ONNX Models
- Hugging Face: pp-ocrv6-onnx
Code Example
The following example configures the OCR scanner to use the Small model, sets English as the recognition language, extracts text from an image, and saves the result to a text file.
using System.IO;
using Spire.OCR;
OcrScanner scanner = new OcrScanner();
// Configure the scanner.
ConfigureOptions configureOptions = new ConfigureOptions();
// Set the path to the PaddleOCR 6.0.0 model.
configureOptions.ModelPath = @"Models\6.0.0\small";
// Set the recognition language.
configureOptions.Language = "English";
// Apply the configuration.
scanner.ConfigureDependencies(configureOptions);
// Recognize text in the image.
scanner.Scan("in.png");
// Save the recognized text to a file.
string text = scanner.Text.ToString();
File.WriteAllText("Output.txt", text);
Dependency Updates for .NET Standard
This release adjusts the dependencies required for .NET Standard projects. The following package versions are specified as minimum requirements:
| Package | Minimum Version |
| SkiaSharp | 3.116.1 |
| System.Buffers | 4.6.1 |
| System.Memory | 4.6.3 |
| Microsoft.Win32.Registry | 4.5.0 |
| System.Text.Encoding.CodePages | 4.7.0 |
| System.Security.Permissions | 4.7.0 |
| System.Runtime.CompilerServices.Unsafe | 6.1.2 |
| System.Runtime.CompilerServices.Unsafe | 6.1.2 |
| System.Runtime.InteropServices | 4.3.0 |
| HarfBuzzSharp | 8.3.0.1 |
| Microsoft.Bcl.Numerics | 10.0.11 |
| System.Numerics.Vectors | 4.6.1 |
| System.Threading.Tasks.Extensions | 4.6.3 |
| PolySharp | 1.15.0 |
Spire.Presentation for Java 11.10.4 supports converting PowerPoint to Markdown
We are pleased to announce the release of Spire.Presentation for Java 11.10.4. This version introduces support for converting PowerPoint (PPT & PPTX) documents to the Markdown file format. In addition, an issue related to PPTX-to-PDF conversion, which caused inconsistent content layouts, has been resolved. More details are as follows.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | SPIREPPT-2914 | Added support for converting PPT(X) to Markdown file format.
Presentation presentaion = new Presentation(); presentaion.loadFromFile(inputFile); presentaion.saveToFile(outputFile, FileFormat.Markdown); presentaion.dispose(); |
| Bug Fix | SPIREPPT-3200 | Fixed the issue where the layout of content was inconsistent after converting PPT(X) to PDF. |
Spire.PDF 12.10.7 adds support for PDF form fields and XFA forms
We’re pleased to announce the release of Spire.PDF 12.10.7. This version introduces a new namespace for comprehensive PDF form processing, providing APIs for creating, reading, modifying, and flattening form fields. It also extends support to XFA forms and enables form data import and export in XML, FDF, and XFDF formats. These enhancements provide developers with more flexible and efficient ways to work with interactive PDF forms.
Here is a list of changes made in this release
| 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. |
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.Doc for Java 14.10.6 enhances the conversion from Word to PDF
We're pleased to announce the release of Spire.Doc for Java 14.10.6. This version mainly fixes several issues encountered when converting Word to PDF, replacing long text, and accepting revisions. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug Fix | SPIREDOC-10471 | Fixed the issue where the converted PDF content did not match the original Word document. |
| Bug Fix | SPIREDOC-11959 SPIREDOC-12092 | Fixed the issue where page numbers were displayed incorrectly after updating the Word table of contents field. |
| Bug Fix | SPIREDOC-12025 | Fixed the issue where the document content was incorrect after accepting revisions. |
| Bug Fix | SPIREDOC-12055 | Fixed the issue where extra blank pages were generated when converting Word to PDF. |
| Bug Fix | SPIREDOC-12064 | Fixed the issue where caption numbers were not automatically updated after inserting a caption. |
| Bug Fix | SPIREDOC-12108 | Fixed the issue where memory was not released in a timely manner during Word to PDF conversion. |
| Bug Fix | SPIREDOC-12109 | Fixed the issue where comments were still retained after clearing them, causing the operation to fail. |
| Bug Fix | SPIREDOC-12114 | Fixed the issue where an OutOfMemoryError was thrown when replacing long text. |