An ODP file is an OpenDocument package: a ZIP file with a few extra rules, a manifest that lists its files, and optional encryption, signatures and RDF metadata. This page follows part 2 of OpenDocument 1.3 (OASIS, 27 April 2021); the XML inside is described on the document structure and slides pages.
Files in the package
| Path | Required | Contents |
|---|---|---|
mimetype | Should be present; must be if the manifest has a / entry | application/vnd.oasis.opendocument.presentation, in ASCII, no line end. |
META-INF/manifest.xml | Yes | The manifest. |
content.xml | In practice | The slides. |
styles.xml | In practice | Styles, master slides, handout master, page layouts. |
meta.xml | No | Title, author, dates, statistics. |
settings.xml | No | Application settings. |
manifest.rdf | Only with RDF metadata | The metadata manifest. |
Thumbnails/thumbnail.png | Should be present unless encrypted | The preview, of the first slide. |
META-INF/…signatures… | No | Digital signatures, usually documentsignatures.xml. |
Pictures/, Media/, Object 1/ and others | No | Images, sounds and videos, and embedded charts or formulas as sub-documents in their own folders. |
Folder names other than META-INF/ and Thumbnails/ are
conventions of the programs that write ODP, not of the specification.
ZIP rules
- Every entry is stored (method 0) or deflated (method 8).
mimetypeis the first entry, stored, with no extra field:PKat offset 0, the namemimetypeat 30, the media type at 38.- Encrypted entries are deflated, then encrypted, and marked as stored, with the
encrypted sizes in the ZIP headers and the real size in
manifest:size. - A conforming package has nothing under
META-INF/butmanifest.xmland signature files; an extended package may. - Files refer to each other with relative IRIs, resolved from the folder of the file that holds the reference.
The first 85 bytes of an ODP file
00000000 50 4B 03 04 vv vv 00 00 00 00 tt tt dd dd 33 26 PK............3&
00000010 AC A8 2F 00 00 00 2F 00 00 00 08 00 00 00 6D 69 ../.../.......mi
00000020 6D 65 74 79 70 65 61 70 70 6C 69 63 61 74 69 6F metypeapplicatio
00000030 6E 2F 76 6E 64 2E 6F 61 73 69 73 2E 6F 70 65 6E n/vnd.oasis.open
00000040 64 6F 63 75 6D 65 6E 74 2E 70 72 65 73 65 6E 74 document.present
00000050 61 74 69 6F 6E ation
| Offset | Bytes | Field | Value |
|---|---|---|---|
| 0 | 50 4B 03 04 | Local file header signature | PK\3\4 |
| 4 | vv vv | Version needed to extract | Varies with the writer. |
| 6 | 00 00 | Flags | None. |
| 8 | 00 00 | Compression method | 0, stored. |
| 10 | tt tt dd dd | Time and date | MS-DOS format; varies. |
| 14 | 33 26 AC A8 | CRC-32 | 0xA8AC2633, the CRC of the 47-byte media type. |
| 18 | 2F 00 00 00 | Compressed size | 47. |
| 22 | 2F 00 00 00 | Uncompressed size | 47. |
| 26 | 08 00 | File name length | 8. |
| 28 | 00 00 | Extra field length | 0, as required. |
| 30 | 8 bytes | File name | mimetype |
| 38 | 47 bytes | File data | application/vnd.oasis.opendocument.presentation |
A template (.otp) has
application/vnd.oasis.opendocument.presentation-template instead.
Manifest
META-INF/manifest.xml has one manifest:file-entry for every
file except mimetype and files under META-INF/, and should
have one for /, whose media type must match mimetype.
Folders get an entry only if they hold a sub-document. It is never encrypted.
Namespace: urn:oasis:names:tc:opendocument:xmlns:manifest:1.0.
<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.3">
<manifest:file-entry manifest:full-path="/" manifest:version="1.3"
manifest:media-type="application/vnd.oasis.opendocument.presentation"/>
<manifest:file-entry manifest:full-path="content.xml" manifest:media-type="text/xml"/>
<manifest:file-entry manifest:full-path="styles.xml" manifest:media-type="text/xml"/>
<manifest:file-entry manifest:full-path="Object 1/" manifest:version="1.3"
manifest:media-type="application/vnd.oasis.opendocument.chart"/>
<manifest:file-entry manifest:full-path="Object 1/content.xml" manifest:media-type="text/xml"/>
</manifest:manifest>
Elements
| Element | In | Attributes | Meaning |
|---|---|---|---|
manifest:manifest | (root) | manifest:version | Contains encrypted-key and file-entry elements. |
manifest:file-entry | manifest | full-path, media-type, preferred-view-mode, size, version | A file or sub-document folder; may contain encryption-data. |
manifest:encryption-data | file-entry | checksum, checksum-type | Contains algorithm, start-key-generation, key-derivation. |
manifest:algorithm | encryption-data | algorithm-name, initialisation-vector | The cipher; empty for Blowfish. |
manifest:start-key-generation | encryption-data | start-key-generation-name, key-size | Password to start key; absent means SHA1, 20 bytes. |
manifest:key-derivation | encryption-data | key-derivation-name, iteration-count, key-size, salt | Start key to file key. |
manifest:encrypted-key | manifest | – | A key encrypted for a recipient (OpenPGP), new in 1.3: encryption-method, keyinfo, CipherData. |
manifest:encryption-method | encrypted-key | PGPAlgorithm | The algorithm that encrypted the key. |
manifest:keyinfo | encrypted-key | – | Contains PGPData. |
manifest:PGPData | keyinfo | – | Contains PGPKeyID and PGPKeyPacket. |
manifest:PGPKeyID | PGPData | – | OpenPGP key ID (RFC 4880), base64. |
manifest:PGPKeyPacket | PGPData | – | OpenPGP key material packet, base64. |
manifest:CipherData | encrypted-key | – | Contains CipherValue. |
manifest:CipherValue | CipherData | – | The encrypted key, base64. |
Attributes
| Attribute | Values |
|---|---|
manifest:version | On manifest: 1.3. On file-entry: the format version of that file or sub-document. |
manifest:full-path | The path as in the ZIP central directory; / for the package. |
manifest:media-type | The MIME type of the file or of the document in a folder. |
manifest:preferred-view-mode | On / only: edit, presentation-slide-show (open straight into the slide show), read-only, or a namespaced token. |
manifest:size | Required for encrypted files: the size before compression and encryption. |
manifest:checksum-type | SHA1/1K or urn:oasis:names:tc:opendocument:xmlns:manifest:1.0#sha1-1k (SHA-1 of the first 1,024 bytes of the compressed, unencrypted file), …#sha256-1k (SHA-256 of the same), an XML Encryption digest IRI, or an extended package’s own IRI. |
manifest:checksum | That digest, base64. Used to confirm the password, not for security. |
manifest:algorithm-name | Blowfish CFB or urn:oasis:names:tc:opendocument:xmlns:manifest:1.0#blowfish (8-bit CFB), an XML Encryption IRI such as http://www.w3.org/2001/04/xmlenc#aes256-cbc, or an extended package’s own IRI. |
manifest:initialisation-vector | The vector, base64, as long as the cipher needs. |
manifest:start-key-generation-name | SHA1 (default), http://www.w3.org/2000/09/xmldsig#sha1, http://www.w3.org/2000/09/xmldsig#sha256 (recommended), or another digest IRI. |
manifest:key-size | Key length in bytes: default 20 for the start key, 16 for the derived key. |
manifest:key-derivation-name | PBKDF2 or …manifest:1.0#pbkdf2 (PBKDF2 with HMAC-SHA-1), PGP, or an implementation’s IRI. |
manifest:iteration-count | PBKDF2 iterations (1,024 in the legacy scheme). |
manifest:salt | Random salt, base64 (16 bytes in the legacy scheme). |
manifest:PGPAlgorithm | Implementation-defined IRI of the OpenPGP algorithm. |
Encryption
- Start key: a hash of the password’s UTF-8 bytes (SHA-1, 20 bytes, in the legacy scheme; SHA-256 recommended).
- File key: PBKDF2 from the start key with a new random salt per file (legacy: HMAC-SHA-1, 1,024 iterations, 16-byte salt, 128-bit key).
- The file is deflated and then encrypted with that key and a random initialisation vector (legacy: Blowfish, 8-bit CFB, 8-byte vector; later files usually AES-256 in CBC mode).
Writers that encrypt must support Blowfish CFB and PBKDF2; readers must also accept the SHA1/1K and SHA-256/1K checksums. Sizes, iteration counts and algorithms must be read from the manifest. An encrypted presentation must not have a thumbnail of its slides.
Digital signatures
Signature files are under META-INF/ and have signatures in
their names. The root is dsig:document-signatures
(urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0,
dsig:version="1.2") holding W3C XML Signature
ds:Signature elements, each with an Id and a
ds:KeyInfo that should carry the X.509 certificate and its issuer and
serial number. A ds:Reference with no Type or the type
http://docs.oasis-open.org/office/v1.2/OS/OpenDocument-v1.2.odt names a
file of the package; one with http://uri.etsi.org/01903#SignedProperties
points at XAdES signed properties. Only canonicalisation transforms are allowed. The
signing time goes in a ds:SignatureProperty with dc:date or in
xades:SigningTime. The usual order is to encrypt, then sign; signatures
then cover the encrypted files and are not themselves encrypted.
RDF metadata
manifest.rdf, in the root or a sub-document’s folder, lists the RDF/XML
metadata files with the terms pkg:Document, pkg:File,
pkg:MetadataFile, pkg:Element, pkg:hasPart and
pkg:mimeType, in the namespace
http://docs.oasis-open.org/ns/office/1.2/meta/pkg#. It is needed only when
there is RDF metadata.
Thumbnail
Thumbnails/thumbnail.png is a PNG preview
of the first slide, with no frame or shadow, of a size that looks right when fitted into
256 × 256 pixels.