viewhack

Open XPS and OXPS files without the XPS Viewer

Someone sent you an .xps or .oxps file, and nothing on your Mac, Chromebook or phone opens it; since the April 2018 update, even Windows 10 and 11 no longer install the XPS Viewer by default. Drop the file here: every page is drawn with the document's own fonts, its text can be searched and copied, and any page saves as a PNG.

The file is read on your device. It is not uploaded, and nothing in it is fetched or run.

What it shows

What is inside an .xps file

XPS is Microsoft's fixed-page format from 2006, its answer to PDF, and OpenXPS is the same design standardised as ECMA-388 in 2009. Both are ZIP archives, which is why the file starts with PK. Inside, FixedDocumentSequence.fdseq (or FixedDocSeq.fdseq) lists the documents, each .fdoc lists its pages, and each .fpage is one page written in XML: Canvas groups, Path shapes whose outlines are written in a short code (M 72,183.9 L 172.15,183.9 ... Z), and Glyphs elements holding the text and its exact glyph positions. Positions are in 1/96 of an inch, so a US Letter page is 816 × 1056 units and an A4 page 794 × 1123.

The fonts are stored as .odttf files named by a GUID, such as Resources/31B91C59-562F-22BA-4218-644B40479162.odttf. They are ordinary TrueType fonts whose first 32 bytes are XORed with the 16 bytes of that GUID, read in reverse order. It is a licence formality, not protection: this page reverses it with the file name alone, which is what every XPS reader does.

An .oxps file differs from an .xps mainly in its XML namespace (schemas.openxps.org rather than schemas.microsoft.com/xps/2005/06) and a few renamed relationships, which is why the old Windows 7 XPS Viewer refuses .oxps files. This page reads both. Windows 8 and later save .oxps from “Microsoft XPS Document Writer” unless a program asks for the old format.

Files it opens

.xps: XPS 1.0
Written by “Microsoft XPS Document Writer” on Windows Vista and 7 (and by some programs on later versions), by Word's “Save as XPS”, and by some scanners and document-management systems.
.oxps: OpenXPS (ECMA-388)
What “Microsoft XPS Document Writer” saves by default on Windows 8, 10 and 11.
Pictures inside
PNG, JPEG, GIF, BMP, and TIFF (decoded by the MIT-licensed UTIF library that the photo viewer also uses). JPEG XR is named and left as a grey box, see below.
On Windows
The XPS Viewer can still be added: Settings, Apps, Optional features, Add a feature, “XPS Viewer”. It needs an administrator account and a download from Microsoft; this page needs neither.

What this cannot do