Skip to main content

Module odf

Module odf 

Source
Expand description

OpenDocument — .odt, .ods, .odp.

A ZIP package like Office Open XML, and the ZIP layer ([crate::container::zip], ADR-0028) and the one-level descent into embedded images ([crate::container::package], ADR-0029) are shared with it unchanged. What is inside the package is not shared, and the differences are not cosmetic — ADR-0031 records them. The four that shape this module:

  1. Parts are found by name, not by declared type. ADR-0030 matches Office property parts on their content type, because docProps/ is a convention and the content type is the contract. ODF is the other way round: meta.xml, settings.xml, and META-INF/manifest.xml are named by ODF 1.3 Part 2 §3.1, while the manifest gives meta.xml the media type text/xml — the same as every other XML part in the package. There is no type to match on, so the rule that is right for one format is unusable in the other.
  2. Authorship is element text, not an attribute. See [rules].
  3. An encrypted package does not look encrypted to ZIP. ODF encrypts entry data itself and records it in the manifest (Part 2 §3.4), so the general-purpose-bit refusal that catches an encrypted Office document passes an encrypted OpenDocument through. Refusing it is this handler’s job, and it is the most dangerous thing in this module.
  4. An embedded chart is not a nested container. LibreOffice stores one as ordinary entries in the same archive — Object 1/content.xml, Object 1/meta.xml — so its author metadata is reachable in the same pass, with no recursion at all. The equivalent Office document holds a whole .xlsx inside itself and is refused (§7.6). Same feature, opposite outcome, because of how the two formats store it.

§Where the metadata is

  • meta.xml — the document’s own metadata: meta:initial-creator and dc:creator (which in ODF is the last person to save it), meta:creation-date and dc:date, meta:printed-by and meta:print-date, meta:generator (which names the operating system as well as the application), meta:user-defined properties, meta:template pointing at a file on the author’s machine, and the pair with no Office counterpart worth calling equivalent: meta:editing-cycles and meta:editing-duration.
  • settings.xml — window geometry, the last cursor position, and — the reason it is removed rather than scrubbed — the printer’s name and its base64 setup blob, plus a per-release set of configuration keys that fingerprints the producing build.
  • Thumbnails/thumbnail.png — a rendered preview of the first page (Part 2 §3.8). It survives every redaction applied to the text, exactly as an Exif thumbnail survives cropping.
  • Configurations2/ — the producer’s saved user-interface configuration.
  • Pictures/ — whole JPEG, PNG, and WebP files with whatever their cameras wrote.
  • content.xml and styles.xml — comment and revision authorship, and fields holding a cached copy of the author’s name.
  • The ZIP entry headers themselves, as for every package format.

Structs§

OdfHandler
Removal of metadata from OpenDocument documents.