What Is XPS?
XPS — XML Paper Specification — is a fixed-layout document format created by Microsoft and introduced with Windows Vista in 2007. Like PDF, an XPS file captures the exact appearance of a page independent of the printer or screen used to render it. Structurally, XPS is a ZIP archive containing XML page descriptors, fonts embedded as OpenType, and images encoded as PNG or JPEG. The format was later standardized as OpenXPS (ECMA-388) with the .oxps extension, though .xps remains by far the more common variant in practice.
XPS vs PDF: The Intended Rivalry
When Microsoft introduced XPS, it was positioned as a direct competitor to Adobe's PDF. The pitch was that XPS integrated natively into the Windows print pipeline — any Windows application could generate an XPS document simply by printing to the "Microsoft XPS Document Writer" virtual printer, with no extra software needed.
| Dimension | XPS | |
|---|---|---|
| Container | ZIP (Open Packaging Conventions) | Custom binary/cross-reference |
| Markup | XML (XAML-like) | PostScript-derived operators |
| Fonts | OpenType embedded | Any embedded font format |
| Color spaces | sRGB, scRGB, ICC profiles | Full ICC, CMYK, spot colors |
| Security | Password encryption (AES) | Full security/DRM ecosystem |
| Forms | Static only | Interactive (AcroForms, XFA) |
| Digital signatures | Supported | Supported |
| Ecosystem | Windows-centric | Universal |
| Print fidelity | Excellent on Windows | Excellent everywhere |
The competition did not go well for XPS. PDF's cross-platform nature, mature reader ecosystem, interactive features, and third-party tool support made it the de facto standard. XPS never gained traction outside of Windows-to-Windows document workflows.
The XPS Internal Structure
Because XPS is simply a ZIP file, you can inspect it directly by renaming the extension to .zip and opening it in any archive manager. Inside you will find:
my-document.xps (renamed to .zip)
├── _rels/
│ └── .rels ← relationship file: points to the entry part
├── docProps/
│ └── thumbnail.jpeg ← thumbnail preview image
├── Documents/
│ └── 1/
│ ├── _rels/
│ │ └── FixedDocument.fdoc.rels
│ ├── FixedDocument.fdoc ← list of pages (PageContent parts)
│ └── Pages/
│ ├── 1.fpage ← XML description of page 1
│ ├── 2.fpage
│ └── ...
├── Resources/
│ └── Fonts/
│ └── EmbeddedFont.odttf ← obfuscated OpenType font
└── [Content_Types].xml ← MIME type map for all parts
Each .fpage file is an XML document describing visual elements using a vector canvas model: paths, glyphs (text runs), and images. The coordinate system uses 1/96th inch units (matching the Windows DPI standard), and all colors are expressed as sRGB hex strings or ICC-profile references.
Where XPS Still Appears
Despite losing the war with PDF, XPS persists in specific contexts:
Windows printing pipeline — XPS is the native spool format on Windows Vista and later. When you print to a printer that supports XPS (via the Windows XPS print path), the spool file is XPS. This matters for print fidelity on Windows: the XPS pipeline preserves transparency and color accuracy that the older GDI pipeline could lose.
Government and legal documents — Some European public administrations (particularly in Spain and Germany) adopted XPS for official document exchange in the 2000s. Older archives may contain XPS files as the canonical record of official correspondence.
Windows Fax and Scan — Faxes received via the built-in Windows Fax service are saved as .xps files.
Visual Studio and .NET printing — Applications built on the Windows Presentation Foundation (WPF) framework use XPS natively for document display and printing.
Opening XPS Files
Windows 10 and 11 — The XPS Viewer (xpsrchvw.exe) is included but not installed by default since Windows 10 version 1803. To enable it: Settings → Apps → Optional Features → Add a feature → XPS Viewer. Alternatively, Microsoft Edge and the built-in Photos app can render XPS documents.
Windows 7/8 — XPS Viewer is included and enabled by default.
macOS — No native support. Third-party apps like NiXPS View (commercial) or conversion via command line are required.
Linux — Okular (KDE document viewer) supports XPS natively. The libgxps library provides XPS rendering for GTK-based applications.
iOS/Android — No common mobile apps support XPS. Conversion to PDF before sharing to mobile is recommended.
Converting XPS to PDF
Using Microsoft Print to PDF (Windows, zero extra software)
- Open the
.xpsfile in XPS Viewer. - Press
Ctrl+Pto open the Print dialog. - Select Microsoft Print to PDF as the printer.
- Click Print and choose a save location.
This round-trips through the Windows print pipeline and produces a clean PDF with embedded fonts.
Using LibreOffice (cross-platform)
LibreOffice 6.x and later can open XPS files via its Draw component and export to PDF:
# Convert XPS to PDF via LibreOffice headless
libreoffice --headless --convert-to pdf document.xps
# Batch convert all XPS files in a directory
libreoffice --headless --convert-to pdf *.xps
Note: LibreOffice's XPS support is read-only via an import filter; complex gradients and glyph paths may not render with 100% fidelity, but for most business documents the output is faithful.
Using GhostXPS / Ghostscript
The gxps command-line tool (part of the GhostXPS project, now integrated into Ghostscript 9.x+) offers precise XPS-to-PDF conversion:
# Install on Ubuntu/Debian
sudo apt install ghostscript
# Convert XPS to PDF
gxps -sDEVICE=pdfwrite -sOutputFile=output.pdf -dNOPAUSE -dBATCH input.xps
# Set resolution (default 72 dpi; use 300 for print quality)
gxps -sDEVICE=pdfwrite -r300 -sOutputFile=output.pdf input.xps
Using Python (libgxps bindings)
import subprocess
import os
def xps_to_pdf(xps_path: str, pdf_path: str, dpi: int = 150) -> bool:
"""Convert XPS to PDF using gxps (Ghostscript XPS renderer)."""
cmd = [
"gxps",
f"-sDEVICE=pdfwrite",
f"-r{dpi}",
f"-sOutputFile={pdf_path}",
"-dNOPAUSE",
"-dBATCH",
xps_path,
]
result = subprocess.run(cmd, capture_output=True, text=True)
return result.returncode == 0
# Example usage
success = xps_to_pdf("government_letter.xps", "government_letter.pdf", dpi=300)
print("Converted" if success else "Failed")
Inspecting XPS Content as XML (Python)
Since XPS is a ZIP file, you can extract and read its XML content directly:
import zipfile
import xml.etree.ElementTree as ET
def extract_text_from_xps(xps_path: str) -> str:
"""Extract plain text from an XPS document by parsing fpage XML."""
text_chunks = []
with zipfile.ZipFile(xps_path, 'r') as z:
# Find all .fpage files (one per page)
pages = sorted([n for n in z.namelist() if n.endswith('.fpage')])
for page_path in pages:
xml_data = z.read(page_path)
root = ET.fromstring(xml_data)
ns = {'xps': 'http://schemas.microsoft.com/xps/2005/06'}
# Glyphs elements contain UnicodeString attributes
for glyph in root.iter('{http://schemas.microsoft.com/xps/2005/06}Glyphs'):
ustr = glyph.get('UnicodeString', '')
if ustr:
text_chunks.append(ustr)
return ' '.join(text_chunks)
text = extract_text_from_xps("document.xps")
print(text[:500])
OXPS vs XPS: The OpenXPS Variant
Windows 8 introduced support for OXPS (OpenXPS, .oxps), the ECMA-388 standardized version. OXPS made minor structural changes: content type URIs changed from Microsoft-proprietary to ECMA-registered values. Windows 8+ can open both; Windows 7 and Vista can only open the original .xps.
If you receive an .oxps file on older Windows, rename it to .zip and examine [Content_Types].xml — you will see application/oxps rather than application/vnd.ms-xpsdocument content types. LibreOffice and gxps handle both variants transparently.
XPS in Modern Workflows
The practical recommendation for most users in 2025 is to convert XPS to PDF immediately upon receiving the file. PDF tools (Adobe Acrobat, LibreOffice, Foxit, etc.) are universally available, while XPS support is narrowing even on Windows. Microsoft removed XPS Viewer from Windows 10's default install and has not meaningfully developed the format since 2012.
For archiving official documents that arrived as XPS, convert to PDF/A-1b for long-term preservation. The conversion preserves text, embedded fonts, and vector graphics; only complex transparency effects may be slightly rasterized depending on the converter used.
| Task | Recommended Tool |
|---|---|
| View XPS on Windows | Enable XPS Viewer via Optional Features, or use Edge |
| View XPS on Linux | Okular |
| Convert to PDF (quality) | GhostXPS / gxps |
| Convert to PDF (convenience) | Print to PDF from XPS Viewer |
| Batch convert many files | LibreOffice headless |
| Extract text programmatically | Python + zipfile + XML parsing |
| Archive long-term | Convert to PDF/A |
Related conversions
Document conversions that follow this topic naturally: