NextPDF¶
PDF 2.0 Engine for Modern PHP — Built for Humans, Ready for AI
NextPDF 是商業級的 PDF 生成生態系統,建立在 PHP 8.5 與 Rust FFI 加速技術之上, 完整遵循 ISO 32000-2:2020 (PDF 2.0) 標準。無論是開源專案、SaaS 平台,還是需要 符合法規的企業環境,NextPDF 都提供對應的套件組合。
核心優勢¶
| 指標 | 數值 |
|---|---|
| Composer 套件數量 | 12 個 |
| 條碼符號學支援 | 32+ 種 |
| 標準合規 | PDF 2.0 · PAdES B-LTA · PDF/A-4 · ZUGFeRD |
| PHP 最低版本 | PHP 8.5(透過 Backport 支援 PHP 8.1 / 7.4) |
| 靜態分析等級 | PHPStan Level 10 |
| 原始碼行數 | ~18,000 行(Core) |
生態系概覽¶
以下圖表展示 NextPDF 生態系的套件層次與依賴關係:
graph TD
subgraph Foundation["基礎層 (Foundation)"]
CORE["nextpdf/core<br/>LGPL-3.0<br/>PDF 2.0 引擎核心"]
BACK["nextpdf/backport<br/>LGPL-3.0<br/>PHP 7.4/8.1 降版支援"]
end
subgraph Extended["延伸層 (Extended — 商業授權)"]
PRO["nextpdf/pro<br/>Charts · PAdES B-LTA · PDF/A-4"]
ENT["nextpdf/enterprise<br/>HSM · ZUGFeRD · 批次加速"]
end
subgraph Renderers["渲染層 (Renderers)"]
ART["nextpdf/artisan<br/>Chrome CDP 無頭渲染"]
GOT["nextpdf/gotenberg<br/>Gotenberg 橋接"]
CLO["nextpdf/cloudflare<br/>Cloudflare Workers"]
end
subgraph Frameworks["框架整合層 (Framework Adapters)"]
LAR["nextpdf/laravel"]
SYM["nextpdf/symfony"]
COD["nextpdf/codeigniter"]
end
subgraph Integration["整合層 (Integration)"]
MCP["nextpdf/mcp-server<br/>AI Agent 工具集"]
COM["nextpdf/tcpdf-compat<br/>TCPDF 遷移相容層"]
end
CORE --> PRO
PRO --> ENT
CORE --> ART
CORE --> GOT
CORE --> CLO
CORE --> LAR
CORE --> SYM
CORE --> COD
CORE --> MCP
CORE --> COM
BACK -.->|"AST 降版"| CORE 套件速查¶
基礎層¶
| 套件 | Composer 名稱 | 授權 | 用途 |
|---|---|---|---|
| Core | nextpdf/core | LGPL-3.0 | PDF 2.0 生成引擎、排版、加密、表單 |
| Backport | nextpdf/backport | LGPL-3.0 | 將 Core 降版至 PHP 8.1 / 7.4 |
商業延伸¶
| 套件 | Composer 名稱 | 授權 | 用途 |
|---|---|---|---|
| Pro | nextpdf/pro | 商業授權 | 圖表、PAdES B-LTA、PDF/A-4 |
| Enterprise | nextpdf/enterprise | 商業授權 | HSM 簽章、ZUGFeRD、批次處理 |
渲染橋接¶
| 套件 | Composer 名稱 | 授權 | 用途 |
|---|---|---|---|
| Artisan | nextpdf/artisan | LGPL-3.0 | Chrome CDP 無頭瀏覽器渲染 |
| Gotenberg | nextpdf/gotenberg | LGPL-3.0 | Gotenberg 服務橋接 |
| Cloudflare | nextpdf/cloudflare | LGPL-3.0 | Cloudflare Workers 執行環境 |
框架整合¶
| 套件 | Composer 名稱 | 授權 | 用途 |
|---|---|---|---|
| Laravel | nextpdf/laravel | LGPL-3.0 | Service Provider、Facade、Queue |
| Symfony | nextpdf/symfony | LGPL-3.0 | Bundle、DI、Messenger |
| CodeIgniter | nextpdf/codeigniter | LGPL-3.0 | Services、Helper |
特殊整合¶
| 套件 | Composer 名稱 | 授權 | 用途 |
|---|---|---|---|
| Connect (MCP) | nextpdf/mcp-server | LGPL-3.0 | AI Agent 20 工具,支援 Pro/Enterprise |
| Adaptation | nextpdf/tcpdf-compat | LGPL-3.0 | 舊版 TCPDF 程式碼零修改遷移 |
快速開始¶
安裝 Core 套件¶
產生你的第一份 PDF¶
<?php
declare(strict_types=1);
use NextPDF\Core\Document;
$doc = Document::createStandalone();
$doc->addPage();
$doc->text('Hello, NextPDF!', x: 20, y: 30);
$doc->save('/tmp/hello.pdf');
Backport 相容性:如需在 PHP 8.1 或 7.4 環境執行,請改用
nextpdf/backport。 詳見 PHP 相容性說明。
完整的入門教學請參閱 快速開始指南。
合規與標準¶
NextPDF Core 完整實作以下標準:
- PDF 2.0 — ISO 32000-2:2020
- PAdES B-B — ETSI EN 319 142-1(需 Pro)
- PAdES B-LTA — 長效簽章時間戳記(需 Pro)
- PDF/A-4 — ISO 19005-4 存檔格式(需 Pro)
- ZUGFeRD 2.3 — 電子發票嵌入(需 Enterprise)
- WCAG 2.1 AA — 無障礙標記 (Tagged PDF)
效能加速器:Spectrum / Prisma¶
NextPDF 提供 Rust 原生加速引擎,透過 Sidecar 程序或 FFI 橋接提升高負載場景的吞吐量:
| 加速器 | 套件 | 授權 | 適用場景 |
|---|---|---|---|
| Spectrum | nextpdf/core 內建 | LGPL-3.0 | 字型子集化、圖像壓縮加速 |
| Prisma Pro | nextpdf/pro | 商業授權 | 批次渲染、並行文件生成 |
| Prisma Enterprise | nextpdf/enterprise | 商業授權 | 叢集模式、HSM 硬體加速 |
詳細架構說明請參閱 加速器引擎文件。
文件導覽¶
- 快速開始 — 選擇適合你的套件並在 5 分鐘內產生第一份 PDF
- 安裝指南 — Packagist 開源套件及商業套件認證設定
- 架構說明 — 三層生命週期、模組設計與 Spectrum 整合
- Core 文件 — 完整 API 參考
- Pro 文件 — 圖表、PAdES、PDF/A-4
- Enterprise 文件 — HSM、ZUGFeRD、批次處理
授權¶
- 開源套件(Core、Backport、框架整合、渲染橋接):GNU LGPL-3.0
- 商業套件(Pro、Enterprise):專屬商業授權,需購買授權金鑰
Commercial License
This feature requires a commercial license. Contact our team for pricing and deployment support.
Contact Sales