Open packaging convention

Not to be confused with Open Packaging Format (OPF), an unrelated format that describes the structure of an EPUB file in XML.
Open Packaging Conventions
Developed by Microsoft, Ecma, ISO/IEC
Initial release December 7, 2006 (2006-12-07)
Latest release ISO/IEC 29500:2008 / November 17, 2008 (2008-11-17)
Type of format File archive, data compression
Container for Electronic documents
Contained by ZIP
Extended from XML, ZIP
Standard(s) ECMA-376, ISO/IEC 29500
Website ISO/IEC 29500:2008

The Open Packaging Conventions (OPC) is a container-file technology initially created by Microsoft to store a combination of XML and non-XML files that together form a single entity such as an Open XML Paper Specification (OpenXPS) document. OPC-based file formats combine the advantages of leaving the independent file entities embedded in the document intact and resulting in much smaller files compared to normal use of XML.


The OPC is specified in Part 2 of the Office Open XML standards ISO/IEC 29500:2008 and ECMA-376.[1][2]

The ISO/IEC 29500-2:2008 specification (and the 2nd edition of ECMA-376) makes a normative reference to PKWARE Inc's .ZIP File Format Specification version 6.2.0 (2004), and supplements it with a normative set of clarifications. Note: the older 1st edition of ECMA-376 makes an informative (i.e. non-normative) reference to the newer PKWARE Inc's ".ZIP File Format Specification" version 6.2.1(2005).[1] The ZIP format is not specified by any international standard, but has widespread community and developer acceptance.

Microsoft has submitted a draft in 2006 to the Internet Engineering Task Force for a "pack" URI Scheme (pack://) to be used for URI references to OPC-based packages. The draft expired in 2009, the specified syntax is incompatible with the Internet Standard for URI schemes (STD 66, RFC 3986).[3] The scheme is now listed as historical.[4]


Both the XML Paper Specification (XPS)[5] and Office Open XML (OOXML) use Open Packaging Conventions (OPC), which provide a profile of the common ZIP format. In addition to data and document content in XML markup, files in the ZIP package can include other text and binary files in formats such as PNG, BMP, AVI, PDF, RTF, or even an already packaged ODF file. OPC also defines some naming conventions and an indirection method to allow position independence of binary and XML files in the ZIP archive.

OPC files can be opened using common ZIP utilities. OPC allow indirection, chunking and relative indirection.[6]

File formats using the OPC

The OPC is the foundation technology for many new file formats:[7]

File format Filename extension Content Standard
Autodesk AutoCAD DWFX file format .dwfx CAD design data (2D/3D computer graphicss and technical drawings)
Circuit Diagram Document[8] .cddx Circuit diagram containing layout, connections and embedded components
Family.Show file format[9] .familyx genealogical family data, stories, and photos
Microsoft Application Virtualization file format .appv Portable application
Microsoft Semblio file format .semblio interactive learning material, such as e-books containing images, audio, and video
Microsoft Visual Studio 2010 Extensions file format .vsix integrated development environment extension
Microsoft Windows 8 App Package[10] .appx software package for Microsoft's Windows Store
Microsoft Windows Azure C# Package .cspkg Cloud platform data
Microsoft XML Paper Specification .xps fixed document for document exchange
NuGet Package .nupkg software package for a package management system
Office Open XML Document .docx word processing document ECMA-376, ISO/IEC 29500:2008
Office Open XML Presentation .pptx presentation ECMA-376, ISO/IEC 29500:2008
Office Open XML Workbook .xlsx spreadsheet workbook ECMA-376, ISO/IEC 29500:2008
Open XML Paper Specification .oxps fixed document for document exchange ECMA-388
Siemens PLM Software file format .jtx
MathWorks Simulink model file .slx Dynamic system specification for Model-based design
SMPTE Media Package .smpk Storage format for distribution and playback of multimedia video and audio files. SMPTE ST 2053-2011


OPC is natively supported in Microsoft .NET Framework 3.0 by the System.IO.Packaging namespace. Open source libraries exist for other languages.

Since Packaging API.

Alternatively, ZIP libraries can be used to create and open OPC files, as long as the correct files are included in the ZIP and the conventions followed.

Package, Parts, and Relationships

In OPC terminology, the term package corresponds to a ZIP archive and the term part corresponds to a file stored within the ZIP. Every part in a package has a unique URI-compliant part name along with a specified content-type expressed in the form of a MIME media type. A part's content-type explicitly defines the type of data stored in the part, and reduces duplication and ambiguity issues inherent with file extensions.

OPC packages can also include relationships that define associations between the package, parts, and external resources. In addition to a hierarchy of directories and parts, OPC packages commonly use relationships to access content through a directed graph of relationship associations. Relationships are composed of four elements:

  • an identifier (ID)
  • an optional source (the package or a part within the package)
  • a relationship type (a URI-style expression that defines the type of the relationship)
  • a target (a URI to another part within the package or to an external resource)

OPC packages can store parts that contain any type of data (text, images, XML, binary, whatever). The extension ".rels", however, is reserved for storing relationships metadata within "/_rels" subfolders. The subfolder name "_rels", the file extension ".rels" within such directory, and the filename "[Content_Types].xml" in any folder are the only three reserved names for files stored in an OPC package.

/[Content_Types].xml file
This file defines the MIME media types for all the parts stored in the package. The "/[Content_Types].xml" file defines default mappings based on file extensions, along with overrides for specific parts with content-types that are different from the file extension defaults. For example, one of these defined MIME types is:
The root level "/_rels" folder stores the relationships for the package as a whole. The "/_rels" folder normally contains a file named ".rels". "/_rels/.rels" is an XML file where the starting package-level relationships are stored. Normally when opening an OPC-based file, applications start by accessing to the "/_rels/.rels" file to read the starting package-level relationships.
Each part may have its own relationships. The_rels folders are where one goes to find the relationships for any given part within the package. To find the relationships for a specific part, one looks in the "_rels" folder that is a sibling of that part: If the part has relationships, the "_rels" folder will contain a file that has one's original part name with a ".rels" appended to it. For example, if the content types part file had any relationships, there would be a file called "[Content_Types].xml.rels" inside the "/_rels" folder.

All relationships (including the relations associated to the root package) are represented as XML files. If you open a ".rels" file in a text editor, you can view the actual XML markup that defines all the relationships targeted from that part. A typical relationships file contains XML code like this:

which defines two relations for the root package, the first one being considered as the root package (here for an early Microsoft XPS document, before it was standardized as Open XML Paper Specification within the openxmlformats collection), and the other one being used to reference an alternate form (here a thumbnail rendered image of the first page of the document).

The main parts of the embedded documents are often stored within a folder named "/Document" (which may contain subdirectories itself, if the file contains several related documents each of them with various parts), and the optional metadata parts that are not needed for processing the main parts of the document are stored in a folder named "/Metadata" ; however these actual folder names are actually specified within the XML-formatted data in "[partname].rels" relationship files, and the OPC specification allows any folder organisation that is convenient for the application and these two folder names are not required.


It encourages documents to be split into small chunks. This is better for reducing the effect of file corruption.[11] And better for data access: for example, all the style information in one XML part, each separate worksheet or table in their own different parts. This allows faster access and less object creation for clients, and makes it easier for multiple processes to be working on the same document.

Relative indirection

In the Open Packaging Conventions each file that has reference has its own _rels file with the indirection lists. This makes it easier to cut and paste some information with all its associated resources in some cases, provides name scoping to remove the chance of name clashing between files, and so on.


External links

  • Download specification ISO/IEC 29500-2:2008
  • Download Electronic inserts for ISO/IEC 29500-2:2008
  • OPC: A New Standard for Packaging Your Data
  • Essentials of the Open Packaging Conventions
  • OPC Digital Signatures: Application Guidelines for Common Criteria Security
  • Packaging team blog
  • Open Packaging Conventions (OPC) MSDN Forum
  • The Addressing Model of the Open Packaging Conventions
  • OPC implementation test documents
  • An OPC package explorer that allows you to edit XML parts.
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.