Pajdeg  0.2.2
Pajdeg
Files | Typedefs | Functions

PDF catalog, whose primary purpose is to map PDF objects to pages in a PDF document. More...

Files

file  PDCatalog.h
 

Typedefs

typedef struct PDCatalogPDCatalogRef
 

Functions

PDCatalogRef PDCatalogCreateWithParserForObject (PDParserRef parser, PDObjectRef catalog)
 
PDInteger PDCatalogGetObjectIDForPage (PDCatalogRef catalog, PDInteger pageNumber)
 
PDInteger PDCatalogGetPageCount (PDCatalogRef catalog)
 
void PDCatalogInsertPage (PDCatalogRef catalog, PDInteger pageNumber, PDObjectRef pageObject)
 

Detailed Description

PDF catalog, whose primary purpose is to map PDF objects to pages in a PDF document.

The PDF catalog, usually derived from the "root" object of the PDF, consists of a media box (a rectangle defining the size of all pages) as well as an array of "kids", each kid being a page in the PDF.

The PDParser instantiates the catalog to the root object's Pages object on demand, e.g. when a task filter is set to some page, or simply when the developer requests it for the first time.

Typedef Documentation

typedef struct PDCatalog* PDCatalogRef

A catalog object.

Function Documentation

PDCatalogRef PDCatalogCreateWithParserForObject ( PDParserRef  parser,
PDObjectRef  catalog 
)

Set up a catalog with a PDParser and a catalog object.

The catalog will, via the parser, fetch the information needed to provide a complete representation of the pages supplied by the given catalog object. Normally, the catalog object is the root object of the PDF.

Note
It is recommended to use the parser's built-in PDParserGetCatalog() function for getting the root object catalog, if nothing else for sake of efficiency.
Parameters
parserThe PDParserRef instance.
catalogThe catalog object.
Returns
The PDCatalog instance.
PDInteger PDCatalogGetObjectIDForPage ( PDCatalogRef  catalog,
PDInteger  pageNumber 
)

Determine the object ID for the given page number, or throw an assertion if the page number is out of bounds.

Warning
Page numbers begin at 1, not 0.
Parameters
catalogThe catalog object.
pageNumberThe page number whose object ID should be provided.
Returns
The object ID.
PDInteger PDCatalogGetPageCount ( PDCatalogRef  catalog)

Determine the number of pages in this catalog.

Warning
Page numbers are valid in the range [1 .. pc], not [0 .. pc-1] where pc is the returned value.
Parameters
catalogThe catalog object.
Returns
The number of pages contained.
void PDCatalogInsertPage ( PDCatalogRef  catalog,
PDInteger  pageNumber,
PDObjectRef  pageObject 
)

Insert a page into the catalog.

This does not affect the final representation of the output PDF in any way, but is here to ensure that the representation of a catalog is up to date with page modifications.

Note
The parents' (and grand parents') Count is not updated. This must be done separately.
Parameters
catalogThe catalog
pageNumberThe page number (index starts at 1, not 0)
pageObjectThe page object being inserted