File Structure

This documentation provides an overview of the structure, data organization and components of the Altium file formats .pcblib (PCB library) and .schlib (schematic library). This guide combines information from several open-source repositories:

These resources provide insights into the format used, which is essential for developing tools. The file formats are based on the Microsoft OLE (Object Linking and Embedding) standard, which organizes data (streams) into hierarchical containers. Not all containers or records are known yet, so this list and the associated documentation may be incomplete.

File Structure

LibraryFile_Container.drawio.html

The basic structure is organized in containers. Each library file contains several subcontainers with the component as a footprint or symbol. Each component is composed of so-called records. These records contain the visible structures such as rectangles, polygons and lines. The records for footprints are binary data. Schematic records are mostly parameter collections.

Schematic Library (.schlib)

The .schlib file format stores schematic symbols. It is based on OLE (Object Linking and Embedding) format, a compound document standard from Microsoft.

<file.schlib>/
├── FileHeader
├── Storage
├── <symbol>/
│   ├── PinFrac
│   ├── PinSymbolLineWidth
│   ├── PinWideText
│   ├── PinTextData
│   ├── PinFunctionData
│   └── Data
└── ...

Streams

Container <symbol>

A container for each individual symbol. The naming of this container has some limitations due to the compound document standard. The maximum text length is 31, container names longer than 31 will be truncated. Also, if a / is used in the name, it will be replaced by a _.

  • Structure of <symbol>/Data:
    1. List of Records/Primitives

      1. Records/Primitive as Schematic Records

Work in Progess:

Optional structures: only available if symbol has specific element of structure.

  • Structure of <symbol>/PinFrac:

  • Structure of <symbol>/PinSymbolLineWidth:

  • Structure of <symbol>/PinWideText:

  • Structure of <symbol>/PinTextData:

  • Structure of <symbol>/PinFunctionData:

PCB Library (.pcblib)

The .pcblib file format stores PCB footprints. It is based on OLE (Object Linking and Embedding) format, a compound document standard from Microsoft.

The format follows a structured hierarchy, with several storage containers and data blocks. Below is an overview of the typical structure:

<file.pcblib>/
├── FileHeader
├── FileVersionInfo/
│   ├── Header
│   └── Data
├── Library/
│   ├── ComponentParamsTOC/
│   │   ├── Header
│   │   └── Data
│   ├── LayerKindMapping/
│   │   ├── Header
│   │   └── Data
│   ├── Models/
│   │   ├── Header
│   │   ├── Data
│   │   ├── <Embedded 3D Model>
│   │   └── ...
│   ├── ModelsNoEmbed/
│   │   ├── Header
│   │   └── Data
│   ├── PadViaLibrary/
│   │   ├── Header
│   │   └── Data
│   ├── Textures/
│   │   ├── Header
│   │   └── Data
│   ├── Header
│   ├── Data
│   └── EmbeddedFonts
├── <footprint>/
│   ├── PrimitiveGuids/
│   │   ├── Header
│   │   └── Data
│   ├── UniqueIDPrimitiveInformation/
│   │   ├── Header
│   │   └── Data
│   ├── Header
│   ├── Data
│   ├── Parameters
│   └── WideStrings
└── ...

This list is incomplete and is limited to the essentials for reading and displaying footprints.

Container Library

Contains common elements used in the library as well as a table of contents (TOC)

Container Library/ComponentParamsTOC

Contains name, description, height and pad count of each footprint.

Container Library/Models

Contains embedded 3D models, if used in the footprint.

  • Structure of Library/Models/Header:
    1. Number of embedded models as Unsigned Integer (32-bit)

  • Structure of Library/Models/Data:
    1. Parameter of each embedded model as Parameter Collection

  • Structure of Library/Models/<Embedded 3D Model>:
    1. Embedded Models are stored as ASCII STEP files but using zlib compression

Container <footprint>

A container for each individual footprint. Each footprint consists of multiple primitives. A primitive is a single drawing element, such as a line, arc, rectangle, or pad. The naming of this container has some limitations due to the compound document standard. The maximum text length is 31, container names longer than 31 will be truncated. Also, if a / is used in the name, it will be replaced by a _.

  • Structure of <footprint>/Header:
    1. Number of primitives used in the footprint as Unsigned Integer (32-bit)

  • Structure of <footprint>/Data:
    1. Footprint name as PCB String Block

    2. List of Primitives

      1. PrimitiveID as Unsigned Integer (32-bit).

      2. Primitive as PCB Primitives

  • Structure of <footprint>/WideStrings:
    1. List of encoded text as Parameter Collection

      • Each string entry is encoded inside a parameter string value with a comma separated list of integers.

      • Those values are interpreted as UTF-16 code-points.

  • Structure of <footprint>/Parameters:
    1. List of parameters as Parameter Collection

    2. Default parameters:

      • PATTERN

      • HEIGHT

      • DESCRIPTION

      • ITEMGUID

      • REVISIONGUID