Spire.PDF for C++ 12.10.7 现已正式发布。该版本新增了对多个平台的支持,包括 Win-ARM64、Linux-ARM64 和 OHOS 等。同时,为了全面对齐 .NET 版本的功能,本次版本对产品包进行了重大的结构性调整。 这并非可通过热替换完成升级的补丁包,旧项目不能仅通过替换库文件进行升级,必须修改源码并进行全量重新编译。开发者在升级前需要仔细了解相关调整。
重大 API 调整
为了全面对齐 .NET 版本的功能,本次 Spire.PDF for C++ 对产品包进行了结构性升级。旧项目无法仅通过替换库文件完成升级,需要相应修改源码并进行全量重新编译。
更多详细信息请参考:
调整:
- 新增对以下平台的支持:win-arm64、linux-arm64、linux-musl-arm64、musl_x64、ohos-arm64-v8a、ohos-x86_64、osx-arm64 和 osx-x64。
- 删除了“Spire.Pdf.o.h”头文件,需要根据实际使用的类引入对应子命名空间下的头文件。
- 宽字符使用调整为 UTF-8 窄字符。
旧版本:
#include "Spire.Pdf.o.h"
using namespace Spire::Pdf;
using namespace std;
新版本:
#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;
.......
旧版本:
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);
新版本:
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 for C++ 12.10.7 请点击:







