# Kernel design description

Kernel is object layer which provides interface for manipulation with pdf document, its high level entities (like pages, outlines and annotations) and all properties of entities. All these objects keeps document logic inside and provides interface for higher layer for simple manipulation. Higher layers (GUI and script in our case) should use only these objects to get or change document related information.

All kernel stuff is stored in src/kernel directory and consists of set of classes. Classes are separated to 2 groups according logic related to pdf which is implemented inside class:

- High level objects - which wrapps pdf high level entities, such as pages (), annotations (), outlines, whole document ().

  Each object has certain properties which are defined by pdf specification and those are returned in low level objects form. If pdf entity contains other high level entity in its substructure (like pages contains annotations etc.), this entity is responsible for creation and maintainance of such high level object. CPdf is then root of all high level objects.

- Low level objects - which wrapps pdf data types. Pdf stores all data and meta data in object form. Such objects are strongly typed and pdf specification describes how each data type is stored to document. According value type character (what can be stored inside) we will distinguish 2 cathegories of data types:
  - Simple types which holds simple data such as integral values, floating point value, string, name, operator, etc.
  - Complex types which holds other data types in their inside such as array, dictionary and streams.

Following chapters will focus more deeply on particular parts of kernel stuff. At first, all classes which are used as interface objects for higher layers are described. Then some kernel classes which are not part of interface but they are used internally by interface classes. Finally there is description how document changes and revisions are handled.

&kernel_interface_objects;

&kernel_helper_objects;

&kernel_layer_model;