$npx -y skills add DevExpress/agent-skills --skill devexpress-office-file-api-pdf-newCreate, load, modify, secure, and print PDF documents using the new DevExpress.Docs.Pdf API — a modern object-oriented DOM approach for .NET. Use when building .NET applications that need to programmatically generate or edit PDF files using the new DevExpress PDF Document API (CT
| 1 | # DevExpress New PDF Document API (CTP) |
| 2 | |
| 3 | > [!IMPORTANT] **Community Technology Preview (CTP)** |
| 4 | > The `DevExpress.Docs.Pdf` library is currently available as a CTP. **Do not use it in mission-critical production applications.** Try the library, share feedback, and await the official release. The legacy `DevExpress.Pdf` (PdfDocumentProcessor) API remains fully supported. |
| 5 | |
| 6 | The new DevExpress PDF Document API (`DevExpress.Docs.Pdf`) is a cross-platform .NET library with a strongly-typed, object-oriented document model. It lets you create, load, modify, save, print, encrypt, and structurally tag PDF documents. The entry point is `PdfDocument`, which exposes pages, fragments, annotations, form fields, metadata, structure tree, and attachments as first-class typed collections. Works on Windows, Linux, and macOS. |
| 7 | |
| 8 | ## When to Use This Skill |
| 9 | |
| 10 | - Create new PDF documents with text, images, shapes, and reusable templates |
| 11 | - Load and modify existing PDF files (edit content, add/remove pages, manage annotations) |
| 12 | - Manage interactive forms: create, fill, flatten, import/export AcroForm data |
| 13 | - Find, format, redact, or permanently remove text from PDF documents |
| 14 | - Encrypt PDF documents and set granular permissions (print, modify, extract) |
| 15 | - Build tagged/accessible PDFs (PDF/UA) using the structure tree API |
| 16 | - Merge PDF documents or reorganize pages (clone, reorder, rotate, resize) |
| 17 | - Embed file attachments or ZUGFeRD/Factur-X electronic invoice XML |
| 18 | - Print PDFs cross-platform (Windows, Linux/macOS via CUPS) |
| 19 | - Migrate existing code from `PdfDocumentProcessor` to the new `PdfDocument` API |
| 20 | |
| 21 | ## Prerequisites & Installation |
| 22 | |
| 23 | > **CTP Warning**: This package is a pre-release. Pin to the exact v26.1 version to avoid unexpected changes. |
| 24 | |
| 25 | ### NuGet Packages |
| 26 | |
| 27 | | Package | Purpose | |
| 28 | |---------|---------| |
| 29 | | `DevExpress.Docs.Pdf` | New PDF Document API (CTP) | |
| 30 | |
| 31 | ### .NET (8/9/10+) |
| 32 | |
| 33 | ```bash |
| 34 | dotnet add package DevExpress.Docs.Pdf |
| 35 | ``` |
| 36 | |
| 37 | ### .NET Framework (4.7.2+) |
| 38 | |
| 39 | ``` |
| 40 | Install-Package DevExpress.Docs.Pdf |
| 41 | ``` |
| 42 | |
| 43 | Or add DLL references: `DevExpress.Docs.Pdf.v26.1.dll`, `DevExpress.Data.v26.1.dll`, `DevExpress.Drawing.v26.1.dll`, `DevExpress.Printing.v26.1.Core.dll`, `DevExpress.Office.v26.1.Core.dll`, `DevExpress.Docs.Core.v26.1.dll`. |
| 44 | |
| 45 | **Important**: All DevExpress packages in a project must share the same version. A valid DevExpress license is required. |
| 46 | |
| 47 | ### Non-Windows Platform Support (Linux, macOS, Docker, Cloud) |
| 48 | |
| 49 | Despite the new object model, `DevExpress.Docs.Pdf` is built on the same `DevExpress.Drawing` library as the legacy `PdfDocumentProcessor` API (note `DevExpress.Drawing.v26.1.dll` in the .NET Framework assembly list above) — it still uses a platform-specific drawing engine: GDI+ on Windows, SkiaSharp elsewhere. **The SkiaSharp-based engine is enabled automatically on non-Windows platforms.** Enable `Settings.DrawingEngine` at app startup only to force Skia *on Windows* (e.g., to work around the 10K GDI-handle limit). Add the Skia-based drawing engine package for Linux/macOS/Docker/Cloud: |
| 50 | |
| 51 | ```bash |
| 52 | dotnet add package DevExpress.Drawing.Skia |
| 53 | ``` |
| 54 | |
| 55 | On **Linux**, also install the font libraries: `sudo apt-get install -y libc6 libicu-dev libfontconfig1` (Debian/Ubuntu) or `sudo yum install -y glibc-devel libicu fontconfig` (RHEL/CentOS/Fedora). |
| 56 | |
| 57 | For printing on non-Windows, use [PrintOptions.PrinterSettings](https://docs.devexpress.com/OfficeFileAPI/DevExpress.Docs.Pdf.Printing.PrintOptions.PrinterSettings) to print through [CUPS](https://en.wikipedia.org/wiki/Common_UNIX_Printing_System) on macOS/Linux. |
| 58 | |
| 59 | ## Before You Start — Ask the Developer |
| 60 | |
| 61 | If the host agent has a structured question-asking tool available, use it to ask these questions one at a time with clear options — for example, Claude Code's `AskUserQuestion` tool or GitHub Copilot's `askQuestions` tool. If no such tool is available, ask the questions directly in the chat response before generating code. |
| 62 | |
| 63 | Before generating code, confirm the following: |
| 64 | |
| 65 | ### General |
| 66 | 1. **Target framework**: .NET 8+ or .NET Framework 4.x? |
| 67 | 2. **New or existing project?**: Creating fresh or adding to an existing codebase? |
| 68 | 3. **Hosting model**: Console, ASP.NET Core, Blazor, WinForms, WPF, |