All formats

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#