Lib:Architecture
From GNUpdf
[edit]
Overview
This page contains a description of the overall architecture of the GNU PDF Library. It also contain links to the description of the architecture of the library elements.
[edit]
Statement of Purpose
The GNU PDF Library provides functions to read and write PDF documents conforming to the PDF 1.7 specification. This includes visualization (retrieving of bitmaps with rasterized page contents) and interactive features such as annotations and interactive forms. The library also support the generation of specific subsets of PDF conforming to the ISO standards PDF/A, PDF/X and ISO 32000.
[edit]
Library Architecture
The libgnupdf library is composed by several layers:
- Base Layer
- This layer implements basic functionality such as memory allocation, fixed-point arithmetic, interpolation functions, geometry routines, character encoding and access to the filesystem. The base layer is the responsible to provide common system-independent abstractions to other parts of the library.
- Object Layer
- This layer implements the concepts of PDF objects and PDF documents as a structured hierarchy of objects. An API is provided to manipulate that structure and the objects that compound it. Since the object hierarchy can be quite complex a garbage collection mechanism is provided to the client of the layer.
- Document Layer
- This layer implements the concept of PDF documents as a collection of pages, annotations, fonts, sounds, 3d artwork, discussion threads, forms, etc. It is implemented on top of the object layer. An API is provided to manipulate those abstractions.
- Page Layer
- This layer implements several abstractions that represent the contents of a page in a PDF document: text, lines, arcs, bitmaps, etc. This layer also provides rasterized bitmaps with page contents, using some graphics library. An API is provided to both read and write page contents.
Some remarks:
- Each layer is built using the API exported by the underlying layers.
- A client application has access to all layers.
- Each layer export an API that gives access to the functionality it implement to clients.
- As for terminology we use the terms procedure and function meaning the same thing.




