Paged.The open publishing system
The format atlas
Package anatomy

IDML Reference / Package anatomy

The ZIP container

An IDML file is a ZIP archive made self-identifying by a leading, uncompressed mimetype entry and a META-INF folder that points at designmap.xml.

Tier: BeginnerBeginnerIreference

Reviewed against engine v0.71.6

An IDML file is an ordinary ZIP archive made self-identifying by a few reserved entries.

In short The outer layer of an IDML document is a plain ZIP archive that follows the conventions of other open document formats. A tiny mimetype entry comes first and is stored uncompressed, so a tool can read the opening bytes of the file and know what it holds. A META-INF folder carries container.xml, which points at the document's root part, designmap.xml, and usually metadata.xml, the document's XMP metadata. Everything else is the document itself.

The mimetype entry

The first entry in the archive is a file named mimetype whose content is exactly application/vnd.adobe.indesign-idml-package, with no trailing newline. Because it is first and stored rather than deflated, its text sits at a fixed offset near the start of the file, and a tool can identify the archive without decompressing anything.

A writer should therefore:

  • write mimetype as the first entry;
  • store it with no compression;
  • write the media type exactly, with no line break after it.

In Paged: the importer requires a mimetype entry with exactly this text (it tolerates surrounding whitespace) and rejects anything else before reading a part. It does not check that the entry is first or stored. The exporter writes it first and stored. Parsed, not rendered

The META-INF folder

  • container.xml names the document's root part, designmap.xml. It is the "start here" pointer: a consumer that follows the container convention reads it, then the design map, and the design map names everything else. In practice the design map is always at the archive root under that name, and many readers go to it directly.
  • metadata.xml is an XMP packet: the creating application, creation and modification dates, document and instance ids, the fonts and swatches used, page thumbnails. InDesign writes it in every package it exports; it is descriptive, and the document's layout does not depend on it.

Everything after these is the document: designmap.xml, the Resources folder, the MasterSpreads, Spreads and Stories folders, and the XML folder. The next page reads the design map.

In Paged: a .paged file uses the same container with the same mimetype, so InDesign opens it as IDML. Its extra parts are described in the .paged container.

Frequently asked questions

Is an IDML file just a renamed ZIP file? Yes, with conventions. Any ZIP tool can unpack it to show the XML parts inside. What makes it IDML is the leading mimetype entry, the META-INF folder and a designmap.xml at the root.

Why is the mimetype entry stored first and uncompressed? So the archive identifies itself. A tool can read the media type at a fixed position near the start of the file without decompressing anything, the same trick EPUB and OpenDocument use.

What does META-INF/container.xml do? It names the document's root part, designmap.xml. A consumer following the container convention reads it first, then the design map, which names everything else.

Do I have to write META-INF/metadata.xml? It is descriptive metadata, not layout. InDesign writes it in every export, but it opens packages without one: none of the examples in this reference carries a metadata.xml, and each was opened and saved by InDesign.

On this page