Skip to content

Introduction

What is CDIF Normalization?

The @rendering/cdif-normalization npm package helps standardize cimdoc files across different versions. It converts cimdocs from versions 3 and 4 into the version 2 format, where all items are absolutely positioned. This makes it easier to work with cimdocs in your application, regardless of their original version.

Why use CDIF Normalization?

  • Consistent format: Work with a single, unified document structure.
  • Simplified rendering: No need to handle multiple cimdoc versions in your codebase.
  • Backward compatibility: Support new features while maintaining compatibility with existing tools.

Cimdoc Version Differences

Cimdoc v3

In version 3, all items are placed in a single array, organized within panels and subpanels, instead of being separated by type-specific arrays as in version 2.

Cimdoc v4

Version 4 focuses on enabling dynamic design. It introduces extensive use of subpanels and new attributes such as stackDirection, spaceUseStrategy, and aspectRatio. Items in v4 may also have their width and height inferred automatically, rather than being explicitly defined. Additionally, v4 introduces relative sizing for items, allowing their size to be defined as a proportion of their container instead of using only absolute values.