We’re pleased to announce the release of Spire.Doc for C++ 14.9.11. This release is a major structural upgrade, expanding platform support from two to ten targets, introducing a public C API with 4,237 declared functions, and adding capabilities for charts, SmartArt, themes, VBA, digital signatures, and revision tracking.
Important: Version 14.9.11 is not a drop-in replacement for version 13.8.2. Existing projects require source-code modifications and a full rebuild. Replacing the library files alone is not sufficient.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | - | Added support for Windows ARM64, Linux ARM64, Linux musl, macOS ARM64, and HarmonyOS ARM64 and x86_64, expanding platform support to ten targets. |
| New Feature | - | Introduced a public C API with 4,237 declared functions in Spire.Doc.C.h. |
| New Feature | - | Added APIs and classes for charts, SmartArt, themes, VBA projects, digital signatures, revision tracking, document navigation, page operations, and rendering. |
| New Feature | - | Added XLSX export support and expanded Markdown export options, custom font management, document protection, and document-format APIs. |
| Adjustment | - | Reorganized C++ header files and namespaces. |
| Adjustment | - | Changed string handling across many APIs from wide-character strings to UTF-8 strings. |
| Adjustment | - | Redesigned list-style management and updated several commonly used methods and classes. |
| Adjustment | - | Changed library names and platform-specific library directories. |
| Adjustment | - | Updated the binary interface. Existing projects must be rebuilt with the new headers and libraries. |
1. Version Comparison: 13.8.2 vs. 14.9.11
| Item | Version 13.8.2 | Version 14.9.11 |
| Target platforms | 2 | 10 |
| Package size | 343.5 MB | 918.8 MB |
| Header files (.h) | 417 | 508 |
| Public C API | Not available | 4,237 declared functions |
| Exported class definitions | 271 | 336 |
| AOT library version | 13.8.2.17370 | 14.9.11.3420 |
| Demo source files (.cpp) | 311 | 330 |
The package size increased from 343.5 MB to 918.8 MB, alongside the expanded platform support and package reorganization.
2. Platform and Binary Changes
Version 14.9.11 introduces support for the following platform targets:
- Windows: win-x64, win-arm64
- Linux with glibc: linux-x64, linux-arm64
- Linux with musl: linux-musl-x64, linux-musl-arm64
- HarmonyOS: ohos-x86_64, ohos-arm64-v8a
- macOS: osx-x64, osx-arm64
The package layout and binary dependencies have also changed:
- The Windows library name has changed from Spire.Doc.Cpp.dll to SpireDocCpp.dll. The corresponding import library name has changed as well.
- Platform-specific libraries are now organized under directories such as lib/win-x64, lib/linux-arm64, and lib/ohos-arm64-v8a.
- HarfBuzz has been added alongside Skia, introducing an additional native dependency.
- The new package does not provide 32-bit targets.
Deployment Requirements
Before deploying the new version, review the following requirements:
- Linux glibc: The target environment must use glibc 2.29 or later.
- Linux musl and HarmonyOS: ICU and fontconfig dependencies must be deployed as required by the package documentation. Missing dependencies may cause failures when constructing a Document object or loading Skia.
- HarmonyOS: Use the ohos-clang toolchain provided by DevEco Studio, as specified in the package documentation.
- Text rendering: Ensure that the required native dependencies, including HarfBuzz, are available in the deployment environment.
For the exact compiler, linker, and runtime configuration, consult the README files included with the new package.
3. Header Files and Namespace Reorganization
The former Spire.Doc.o.h entry-point header has been removed. Version 14.9.11 introduces a new header structure under include/Spire/Doc/, organized into namespaces and functional areas corresponding more closely to the .NET API.
The new package also provides Spire.Doc.C.h, which contains the public C API.
Include Directories
The new package documentation specifies the following three include directories:
include
include/Spire/Doc
include/Spire/Doc/common/h
Existing projects must update their header includes and compiler configuration to match the new structure.
Namespace Changes
In version 13.8.2, most classes were located in Spire::Doc. In version 14.9.11, classes are distributed across additional namespaces, including:
- Spire::Doc::Documents
- Spire::Doc::Fields
- Spire::Doc::Formatting
- Spire::Doc::Collections
- Spire::Doc::Pages
- Spire::Doc::Fields::Shapes::Charts
- Spire::Doc::Reporting
- Spire::Doc::Interface
For example, Document, Section, and Table remain in Spire::Doc, while classes such as Paragraph, TextRange, and CharacterFormat belong to more specific namespaces.
As a result, existing code that relies only on using namespace Spire::Doc; may require additional namespace qualifications.
4. Breaking API Changes
Version 14.9.11 includes significant changes to the public C++ interface. The following examples illustrate some of the updates that may require source-code modifications.
4.1 String ABI: Wide Characters to UTF-8
Many APIs have changed from wide-character strings to UTF-8 strings.
Version 13.8.2:
typedef const wchar_t* LPCWSTR_S; intrusive_ptr<TextRange> AppendText(LPCWSTR_S text);
Version 14.9.11:
typedef const char* LPCWSTR_S; intrusive_ptr<TextRange> AppendText(const std::string& text);
Other affected APIs include:
- Document::LoadFromFile() and Document::SaveToFile(), which now use const std::string& for the relevant parameters.
- Style::GetName(), which now returns std::string by value.
- Other methods that previously accepted or returned wide-character strings.
When migrating existing code, replace wide-character literals such as L"example", std::wstring, and wchar_t* where necessary to match the new UTF-8 API. When using MSVC, configure source encoding with /utf-8 as required by the new headers.
4.2 ListStyle and Style Collection API Redesign
Version 13.8.2:
auto listStyle = new ListStyle(document, ListType::Numbered);
listStyle->SetName(L"MyStyle");
for (int i = 0; i < listStyle->GetLevels()->GetCount(); i++)
listStyle->GetLevels()->GetItem(i);
document->GetListStyles()->Add(listStyle);
Version 14.9.11:
auto listStyle = document->GetStyles()->Add(ListType::Numbered, "MyStyle");
for (int i = 0; i < listStyle->GetListRef()->GetLevels()->GetCount(); i++)
listStyle->GetListRef()->GetLevels()->GetItem(i);
document->GetStyles()->Add(listStyle);
The main changes include:
- The ListStyle constructor is now protected. Instances must be created through factory methods such as StyleCollection::Add(ListType, name).
- ListStyle::GetLevels() has been removed and replaced by GetListRef()->GetLevels().
- Document::GetListStyles() and AddListStyle() have been removed in favor of Document::GetStyles().
- StyleCollection now provides Add(ListType, name) and Add(StyleType, name) overloads.
- ListFormat now works with ListDefinitionReference, introducing methods such as ApplyListRef, GetCurrentListRef, and SetCurrentListRef.
4.3 Other Renamed or Removed APIs
Representative changes include:
- Document::CloneDocument() → Document::Clone()
- Table::GetTableFormat() → Table::GetFormat()
- Table::GetTableStyleName() → TableFormat::GetStyleName()
- TableCell::GetWidth(), SetWidth(), and SetCellWidthType() → GetCellWidth() and SetCellWidth(width, type)
- Paragraph::GetIsFrame() → Paragraph::GetFrame()->GetIsFrame()
- DigitalSignatures → DigitalSignatureCollection
- ISPicture → IPicture
- SpireString → String
- MathObject → OfficeMath
- TextEffect → TextEffectFormat
License configuration has also been reorganized under License::LicenseProvider. Check the new headers for the exact replacement methods and signatures.
In addition, some methods previously exposed by Document, including CreateObjectByTypeName, CreateParagraphItemByType, GetOriginalFileFormat, GetUseNewEngine, GetXHTMLValidateOption, OpenOnlineBin, and SaveToOnlineBin, are no longer available in the same form.
This list is representative rather than exhaustive. Review the new headers when migrating code that depends on less commonly used classes or methods.
4.4 Event Registration in the C++ Wrapper
Several event-registration methods previously available on the C++ Document class are no longer exposed by the version 14.9.11 C++ wrapper. These include methods related to page layout, field updates, bookmark layout, and evaluation information.
Some corresponding functions remain available through the new C API, including:
- Document_add_PageLayout
- Document_add_UpdateFields
- Document_add_BookmarkLayout
Applications that rely on these events should review their implementation and determine whether to use the C API or another suitable callback mechanism.
5. New APIs and Document-Processing Capabilities
Version 14.9.11 adds a broad range of APIs and classes across several document-processing areas.
5.1 Document Navigation, Search, and Page Operations
New methods include:
- Search:FindPattern, FindPatternInLine, Paragraph::FindAllString, and Paragraph::FindAllPattern.
- Page operations:ExtractPages, RemovePages, and RemoveBlankPages.
- Rendering and layout:SaveToImages, RenderToScale, RenderToSize, UpdatePageLayout, and UpdateTableLayout.
- Export:SaveToXLSX, GetMarkdownExportOptions, and SaveToFile(..., ExportOptions).
5.2 Charts, SmartArt, Themes, and VBA
The new version introduces classes for additional document content and structure, including:
- Charts: Chart, ChartAxis, ChartSeries, ChartDataLabel, ChartLegend, and ChartTitle.
- SmartArt: SmartArt, SmartArtNode, and related formatting and shape-property classes.
- Themes: Theme, ThemeColors, and ThemeFonts.
- VBA: VbaProject, VbaModule, and VbaReference.
These additions expand the API available for working with document elements and related configuration.
5.3 Digital Signatures, Revision Tracking, and Document Protection
New APIs cover digital signatures, revision tracking, document protection, and related operations. Examples include:
- Sign, HasDigitalSignature, and GetDigitalSignatures
- StartTrackRevisions, StopTrackRevisions, and GetRevisionInfos
- IsEncrypted, HasWriteProtection, SetWriteProtection, and Unprotect
The release also introduces revision-related classes such as RevisionInfo, RevisionsView, MoveRevision, and TextDiffMode.
5.4 Font Management and Formatting
Additional APIs support custom fonts, font fallback settings, hyphenation dictionaries, and formatting options. Examples include:
- SetCustomFonts, SetCustomFontsFolders, and SetGlobalCustomFonts
- SetDefaultSubstitutionFontName and LoadFontFallbackRuleSettings
- RegisterHyphenationDictionary and UnregisterHyphenationDictionary
- New formatting properties for character, paragraph, and table formats
5.5 Export Formats and Public C API
The FileFormat enumeration has been expanded with values including Dot, OOXML, Ott, Mhtml, HtmlFixed, PostScript, PCL, OFD, OnlineDoc, Wps, Wpt, XLSX, and Auto.
The new public C API is defined in include/Spire.Doc.C.h and contains 4,237 declared SPIRE_DOC_API functions. It provides a C-language interface alongside the C++ wrapper and the underlying AOT exports. The interface uses UTF-8 strings and object handles, as defined in the header.
6. Migration Checklist
Before upgrading an existing project from version 13.8.2 to 14.9.11, complete the following checks:
- Rebuild the entire application. Do not mix object files compiled against the old version with the new libraries. The package documentation warns that changes to interface and virtual-table layouts require a full rebuild.
- Update header paths. Remove dependencies on Spire.Doc.o.h and use the new headers under Spire/Doc/.
- Update include directories and namespaces. Configure the required include paths and add namespace qualifications where needed.
- Migrate string handling. Update wide-character strings to match the new UTF-8 API, and configure /utf-8 for MSVC where required.
- Update API calls. Review list-style management, table-width methods, cloning methods, formatting APIs, and license configuration.
- Review event handling. The C++ wrapper no longer exposes some event-registration methods; use the C API or another suitable approach where necessary.
- Update linker and runtime settings. Use the new Windows library name and platform-specific library directories, and deploy required native dependencies such as HarfBuzz, ICU, and fontconfig where applicable.
- Check the C++ language standard. The package migration notes specify C++11/14 and identify a potential byte definition conflict with C++17. Verify compatibility with the actual build environment.
- Rebuild and test representative workflows. Validate document loading, editing, rendering, and export before deploying to production.
Note on Packaged Demos
Some packaged demo sources may still reference the removed Spire.Doc.o.h header, the previous library path, or wide-character strings. Consequently, certain demos may require updates before they compile against version 14.9.11.
If a demo fails to compile, consult the new README and its examples for the updated include paths, string types, and linker settings.