OpenXPS is defined by ECMA-388, first edition, June 2009, built from the Microsoft XML Paper Specification that Microsoft gave to Ecma in 2007. The file is a ZIP package following the Open Packaging Conventions (ECMA-376 Part 2), with the same parts, elements and attributes as XPS; what changed is the identifiers and some referenced formats. The element-level details are therefore those on the XPS pages for document and page markup, geometry, brushes and colour and text, fonts and images, read with the namespaces below.
Telling OpenXPS from XPS
| Where | OpenXPS | XPS |
|---|---|---|
Start part relationship in /_rels/.rels | http://schemas.openxps.org/oxps/v1.0/fixedrepresentation | http://schemas.microsoft.com/xps/2005/06/fixedrepresentation |
Namespace of FixedDocumentSequence, FixedDocument, FixedPage | http://schemas.openxps.org/oxps/v1.0 | http://schemas.microsoft.com/xps/2005/06 |
| Extension | .oxps (recommended) | .xps |
| Media type of the file | application/oxps (registered with IANA) | application/vnd.ms-xpsdocument |
The first bytes of both are the ZIP signature 50 4B 03 04, and the part
content types are the same, so a reader must open /_rels/.rels and look
at the start part’s relationship type.
Readers such as MuPDF and libgxps accept either type. Windows 8 and later write
OpenXPS from the Microsoft XPS Document Writer.
Namespaces and relationship types
From ECMA-388 Annex D, tables D–1, D–2, D–5 and D–6. The XPS-specific identifiers
moved from http://schemas.microsoft.com/xps/2005/06 to
http://schemas.openxps.org/oxps/v1.0, keeping the last part of the name;
the Open Packaging Conventions identifiers are unchanged.
XML namespaces
| Namespace | Used for |
|---|---|
http://schemas.openxps.org/oxps/v1.0 | FixedDocumentSequence, FixedDocument and FixedPage markup. |
http://schemas.openxps.org/oxps/v1.0/resourcedictionary-key | The x:Key attribute of resources. |
http://schemas.openxps.org/oxps/v1.0/documentstructure | Document structure and story fragments. |
http://schemas.openxps.org/oxps/v1.0/signature-definitions | Signature definitions. |
http://schemas.openxps.org/oxps/v1.0/discard-control | Discard control. |
http://schemas.openxps.org/oxps-3d/v1.0 | 3D graphics content. |
http://schemas.openxmlformats.org/package/2006/content-types, …/2006/metadata/core-properties, …/2006/digital-signature, …/2006/relationships | Content types, core properties, digital signatures and relationships (OPC). |
http://schemas.openxmlformats.org/markup-compatibility/2006 | Markup compatibility. |
Relationship types
| Relationship type | Meaning |
|---|---|
http://schemas.openxps.org/oxps/v1.0/fixedrepresentation | StartPart: the package’s fixed document sequence. |
http://schemas.openxps.org/oxps/v1.0/required-resource | Fonts, images, profiles and remote dictionaries a page uses. |
http://schemas.openxps.org/oxps/v1.0/restricted-font | Fonts with the print and preview embedding restriction, from the FixedDocument. |
http://schemas.openxps.org/oxps/v1.0/documentstructure | The document structure part. |
http://schemas.openxps.org/oxps/v1.0/storyfragments | A page’s story fragments part. |
http://schemas.openxps.org/oxps/v1.0/printticket | A print ticket. |
http://schemas.openxps.org/oxps/v1.0/signature-definitions | Digital signature definitions. |
http://schemas.openxps.org/oxps/v1.0/discard-control | The discard control part. |
http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties | Core properties. |
http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail | Thumbnail. |
http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin, …/signature, …/certificate | Digital signature origin, signatures and certificates. |
Parts
| Part | Usual name |
|---|---|
| Fixed document sequence | /FixedDocumentSequence.fdseq |
| Fixed document | /Documents/1/FixedDocument.fdoc |
| Fixed pages | /Documents/1/Pages/1.fpage … |
| Fonts (often obfuscated) | /Documents/1/Resources/Fonts/GUID.odttf |
| Images | /Documents/1/Resources/Images/… |
| Document structure | /Documents/1/Structure/DocStructure.struct |
| Print tickets | /Metadata/Job_PT.xml, …/Page1_PT.xml |
| Core properties, thumbnail | /docProps/core.xml, /Metadata/thumbnail.png |
Content types
ECMA-388 (tables D–3 and D–4) keeps Microsoft’s content type strings, so content types do not tell OpenXPS from XPS. They must be written without parameters.
| Part | Content type |
|---|---|
| FixedDocumentSequence | application/vnd.ms-package.xps-fixeddocumentsequence+xml |
| FixedDocument | application/vnd.ms-package.xps-fixeddocument+xml |
| FixedPage | application/vnd.ms-package.xps-fixedpage+xml |
| Remote resource dictionary | application/vnd.ms-package.xps-resourcedictionary+xml |
| DocumentStructure | application/vnd.ms-package.xps-documentstructure+xml |
| StoryFragments | application/vnd.ms-package.xps-storyfragments+xml |
| DiscardControl | application/vnd.ms-package.xps-discard-control+xml |
| SignatureDefinitions | application/vnd.ms-package.xps-signaturedefinitions+xml |
| Font | application/vnd.ms-opentype |
| Obfuscated font | application/vnd.ms-package.obfuscated-opentype |
| ICC profile | application/vnd.ms-color.iccprofile |
| JPEG, PNG, TIFF images | image/jpeg, image/png, image/tiff |
| JPEG XR image | image/vnd.ms-photo |
| Thumbnail | image/jpeg or image/png |
| X3D model | model/x3d+xml (Unicode encoding), model/x3d+binary |
| Core properties | application/vnd.openxmlformats-package.core-properties+xml |
| Relationships | application/vnd.openxmlformats-package.relationships+xml |
| Digital signature origin, signature, certificate | application/vnd.openxmlformats-package.digital-signature-origin, …-xmlsignature+xml, …-certificate |
Font obfuscation
ECMA-388 §9.1.7.3: the last segment of an obfuscated font’s part name is a GUID
written B03B02B01B00-B11B10-B21B20-B30B31-B32B33B34B35B36B37 (two hex
digits per byte), with an optional extension (.odttf, or
.odttc for collections, recommended). The first 32 bytes of the font are
XORed with the bytes B37, B36, B35, B34, B33, B32, B31, B30, B20, B21, B10, B11, B00,
B01, B02, B03, that array used twice. Since that order is the reverse of the order the
digit pairs are written in, a reader can take the 16 bytes as written and XOR font
byte i and byte i + 16 with byte 15 − i.
Extension
Annex E: producers should use .oxps and application/oxps,
must not create OpenXPS files ending in .xps in any case, and should not
use application/vnd.ms-xpsdocument for them. Producers should put an XML
comment naming the producing software straight after the FixedPage
start-tag.
What ECMA-388 changed
- New namespaces and relationship types, as above, and the
.oxpsextension andapplication/oxpsmedia type. - Images: JPEG XR replaces HD Photo (Windows Media Photo); JPEG, PNG and TIFF remain.
- Fonts are defined by reference to ISO/IEC 14496-22 (Open Font Format) rather than Microsoft’s OpenType specification.
- Colour: ICC profiles (ICC.1:2001-04 required, ISO 15076-1 optional) are the colour management model; the Windows Color System profiles XPS allowed are no longer required.
- Print tickets: the Microsoft Print Schema is no longer a normative reference; print ticket parts may still be present.
- 3D: X3D content may be embedded, with a required 2D fallback through markup compatibility; such files are not known to be in use.
Sources
- ECMA-388, first edition (June 2009) – §9.1.7.3 (font obfuscation), Annex D (namespaces, content types, relationship types) and Annex E (extension and media type)
- Library of Congress: OpenXPS – summary of the changes from XPS 1.0