Skip to Content
NexPDF

What is NexPDF

How the NexPDF SDK is built, what it does, and how the language SDKs relate to each other.

English

NexPDF is a commercial PDF SDK. Its engine is written in Rust with no C or C++ dependency, so the same code builds for Linux, macOS, Windows, iOS, Android and WebAssembly. Every language SDK is a thin binding over that engine, so features and behaviour are the same on every platform.

What it does

AreaHighlights
RenderingVector and raster content, Type 1, TrueType, CFF, Type 3 and CID fonts, shadings, patterns, transparency groups, soft masks, blend modes, overprint simulation, ICC colour, JPEG, JPEG 2000, JBIG2 and CCITT images, thumbnails
TextExtraction in reading order, Markdown, HTML and JSON export, search
EditingInsert, delete, rotate, crop and reorder pages, merge and split, watermarks, Bates numbering, bookmarks, optimisation, text and image editing
AnnotationsCreate, edit, move and flatten annotations; appearance streams; XFDF import and export
FormsAcroForm fill, extract and flatten; FDF, XFDF and JSON data; keystroke, validate, calculate and format scripts in a sandboxed JavaScript engine
SecurityAES-128 and AES-256 encryption with permissions, PAdES signatures (B-B, B-T, B-LT), verification, destructive redaction
StandardsPDF/A (ISO 19005) and PDF/UA (ISO 14289) conversion and validation
ConversionTo PDF: Word, Excel, PowerPoint, HTML, Markdown, images, EPUB, FictionBook, CBZ, XPS. From PDF: Word, Excel, PowerPoint, HTML, SVG, PNG, RTF, CSV, XML, JSON
OutputFull rewrite, incremental update, linearized "Fast Web View" files
OCROCR pipeline with an invisible, searchable text layer; visual and text document comparison

Not every format in this table is exposed by every SDK. Each SDK's guides and API reference list the calls it has.

Architecture

                    ┌──────────────────────────────────────────────┐
                    │ NexPDF engine (Rust)                         │
                    │ parser · renderer · text · editor · forms ·  │
                    │ crypto · standards · convert · OCR · license │
                    └──────────────┬──────────────────┬────────────┘
                                   │                  │
                     C ABI  nexpdf.h            WebAssembly
                     libnexpdf_ffi              nexpdf_bg.wasm
                                   │                  │
   ┌──────────┬──────────┬─────────┼─────────┬────────┴───┬───────────┐
 Python     Java      .NET        Go   C/C++ · PHP · Rust  Web     Node.js
 Swift (iOS/macOS) · Android (JNI) · Flutter (dart:ffi) · MAUI · React Native (nexpdf_invoke)
  • One engine. The parser, renderer, text extraction, editing, forms, cryptography, standards, conversion and OCR all live in the Rust crates of the engine.
  • One C ABI. nexpdf.h declares about 160 functions. Documents are opaque handles; options and results that are structured are JSON strings, and byte buffers are passed as pointer and length. Every failing call sets a per-thread error message (nexpdf_last_error).
  • Bindings generated from the header. The Python, Java, .NET, Go, C++, PHP, Rust and Swift SDKs are generated from nexpdf.h, so every C function is a method of the document class (when it takes a document) or a library function. The JSON options are identical in every language.
  • WebAssembly for JavaScript. The web and Node.js SDKs run the same engine compiled to WebAssembly, in-process, with no native addon and no server.
  • One JSON entry point for bridges. React Native calls nexpdf_invoke, which exposes the whole API behind a single JSON request so that the native modules stay small.
  • Ready-made readers. iOS, Android, React Native, Flutter, the web viewer components and Electron also ship a complete reader and editor UI, configured with one shared JSON configuration.

Conventions shared by every SDK

  • Page indices start at 0 in the document APIs. The reader UIs report 1-based page numbers in their events.
  • Coordinates are PDF user space: points (1/72 inch), origin at the bottom-left of the page. Rectangles are llx, lly, urx, ury. Each SDK has a page view helper that maps PDF points to screen pixels on rotated or cropped pages.
  • JSON options and results. Methods whose names end in Json return JSON text. Options such as those of OCR, reflow or signing are JSON objects with the same keys everywhere.
  • Errors carry the engine's message, for example password required or no license activated: 'security' requires a NexPDF license key.
  • Threads. A document must be used from one thread at a time. Different documents can be used on different threads, and copy() gives an independent copy.
  • Signed output is final. Write the bytes a signing call returns as they are: saving the document again afterwards breaks the signature.

Next steps

On this page