XPS libraries
XPS is a ZIP of XML, so any ZIP and XML library can read its structure and text. Rendering pages needs a real XPS renderer: libgxps, MuPDF or GhostXPS. MuPDF and GhostXPS are AGPL-3.0 (or commercial from Artifex), and so are the MuPDF bindings below.
| Language | Library | Read | Write | Notes |
|---|---|---|---|---|
| C/C++ | libgxps | yes | no | GNOME library, renders pages with cairo. LGPL-2.1 |
| C/C++ | MuPDF | yes | no | render, extract text, convert XPS to PDF. AGPL |
| C# | System.Windows.Xps | yes | yes | part of WPF, Windows only; reads and writes XPS 1.0 |
| Python | PyMuPDF | yes | no | render, extract text, convert XPS to PDF. AGPL |
| Rust | mupdf | yes | no | safe bindings to MuPDF. AGPL |
GhostXPS (gxps, part of the ghostpdl source tree, AGPL) is a command-line XPS interpreter with the same output devices as Ghostscript. There are no maintained XPS libraries for Java, Go, Ruby or PHP; use a ZIP and XML parser to read the page markup, or convert with mutool first.
By language#
- XPS libraries for C/C++ Open-source C/C++ libraries for XPS and OpenXPS: libgxps renders pages with cairo, MuPDF renders, extracts text and converts to PDF. Comparison.
- XPS libraries for C# Open-source .NET libraries for XPS: System.Windows.Xps from WPF reads and writes XPS documents on Windows. Code examples for creating XPS, extracting text.
- XPS libraries for Python Open-source Python libraries for XPS and OpenXPS: PyMuPDF opens .xps and .oxps files to render pages, extract text and convert to PDF. Code examples.
- XPS libraries for Rust Open-source Rust libraries for XPS and OpenXPS: the mupdf crate opens .xps and .oxps files to render pages, extract text and convert to PDF. Code examples.