From CorelDRAW X4 a CDR file is a ZIP archive. Any
ZIP tool can list what is inside. The drawing itself is still a stream of
RIFF chunks, with the version character
E for X4, F for X5, G for X6 and so on. This page
follows what libcdr reads; the other members are named only as far as their names
show what they are.
Members
| Member | Holds |
|---|---|
content/riffData.cdr | The drawing as one RIFF stream. libcdr looks for it first. |
content/root.dat | The drawing as a RIFF stream whose chunks may keep their data in the files below. libcdr reads it when there is no riffData.cdr. |
content/dataFileList.dat | The names of the data files, one a line, separated by line feeds. |
content/data/ | The data files, under the names the list gives. |
color/profiles/rgb/, color/profiles/cmyk/ | Colour profiles; libcdr reads them for colour conversion. |
| a PNG with “thumbnail” in its name | The preview picture, in place of the DISP chunk of older files. |
metadata/ | Information about the drawing in XML. |
Two packages saved by CorelDRAW 2020 (the metadata says so; the RIFF stream is form
CDRN with a vrsn of 2200) hold these members, which Corel does not
document; the meanings are what the files themselves show:
| Member | Holds |
|---|---|
mimetype | The text application/x-vnd.corel.zcf.draw.document+zip, the first member, as in an OpenDocument package. |
META-INF/container.xml | The list of the main files in the OpenDocument container style: the stream (content/root.dat, type application/x-vnd.corel.cdr.rootdata), the thumbnail (previews/thumbnail.png, its width and height) and one preview a page (previews/page1.png, with a caption). |
META-INF/metadata.xml | XMP metadata: creation, modification and metadata dates, the title and author, the fonts used (cdrinfo:FontsUsed), whether fonts and OLE objects are embedded, the program’s name, core version (2200), build number (474), locale and language, document and instance GUIDs. |
META-INF/textinfo.xml | The text of the drawing as TextStream elements of TextRuns, each with a break kind (para or line) and a language number (1050 is Croatian). For search. |
META-INF/links.xml | Linked files (an empty linkInfo in these). |
color/color.xml | The colour profile names for RGB, CMYK and greyscale, the colour model and the rendering intent, and whether the drawing has RGB, CMYK and greyscale objects. |
color/docPalette.xml | The document palette: colour spaces (name, id, model and values from 0 to 1) and the colours of the page, each a colour space and its tints. |
color/profiles/ | The ICC profiles the colour settings name (sRGB, ISO Coated v2). |
styles/document.cdss | The style sheet as JSON: a version and the named styles with fill, outline and character settings, written as the style strings are. |
font/fontTable.dat | A binary table of the fonts used; the names (family, script, PostScript name, version, style) are 32-bit character counts followed by UTF-16 text; the other fields are not described. |
embed/embedding0 | An embedded font; it starts with a font version string in UTF-16 and the rest is binary that is not described. |
content/data/ | data1.dat, masterPage.dat and page1.dat: chunk data, in the order dataFileList.dat names them. The page’s objects are in page1.dat. |
previews/ | PNG pictures: thumbnail.png and one for each page. |
Chunks kept in data files
From X6 (version 1600), libcdr reads any chunk in the RIFF stream whose length is exactly 16 as a reference to data elsewhere, not as data of its own:
| Offset | Size | Field | Description |
|---|---|---|---|
0 | 4 | Data file | A line of content/dataFileList.dat, counting from 0. |
4 | 4 | Length | How many bytes of that file are the chunk’s data. |
8 | 4 | Offset | Where in the file they start. |
12 | 4 | Unknown | Not read by libcdr. |
The data found there is laid out as the chunk would be in a single stream: a
loda record, a trfd, a fill and so on.
A data file number of 0xFFFFFFFF means the data is in the chunk itself: libcdr
reads the data file number and the length, and the data follows them directly (the
third field then belongs to the data, so a chunk of 16 bytes holds 4 bytes of data when
the length is 4, then 4 bytes libcdr does not read). In the files seen, fver,
vrsn, spnd and some other small chunks are kept this way; for
example a vrsn chunk is ff ff ff ff 02 00 00 00 98 08 00 00 00 00 00 00:
2 bytes of data, 0x0898, version 2200, and 6 more bytes. The same applies to the bigger chunks
(txsm, loda, trfd) of a package whose version is 16 or
later; they point into page1.dat and its fellows.
In the explorer
The explorer shows the archive as a ZIP file, record by record, with the thumbnail and a table of the members. It reads the RIFF stream, follows the references into the data files and draws the pages. Opening the stream’s member shows its chunks as a file of their own, where the references appear as their four fields. A Document tab shows the metadata, container, colour settings, palette, text, font names and styles of the XML, JSON and table members above.