-
Notifications
You must be signed in to change notification settings - Fork 2
Internal structures
A handle is an opaque pointer to handle objects. All functions in Haru include one or more handles in their parameter list. The following figure illustrates the relationship between the various types of handles.
http://libharu.org/figures/figure2.png
The document handle is a handle to operate on a document object. It is created by HPDF_New() or HPDF_NewEx(). And it is freed by HPDF_Free(). When HPDF_Free() is invoked, all objects owned by the document object are freed.
The page handle is used to manipulate an individual page. HPDF_AddPage() or HPDF_InsertPage() create a page handle. Function names starting with "HPDF_Page_" require a page handle as the first parameter.
The image handle is mainly used to put an image to a page. The following functions create an image handle.
- HPDF_LoadPngImageFromFile()
- HPDF_LoadJpegImageFromFile()
- HPDF_LoadRawImageFromFile()
- HPDF_LoadRawImageFromMem()
The font handle is a font object. HPDF_GetFont() creates a font handle.
The encoding handle is a handle to handle a encoding object. A encoding handle is returned by invoking HPDF_GetEncoding().
The outline handle is used to operate an outline of a document. When HPDF_CreateOutline() is invoked, an outline-node object is created and the handle of the node is returned.
The destination object specifies the view of the page to be displayed when the outline item or annotation is clicked. And the destination handle is used to operate destination object.
There are three type of annotation-object in libHaru:
- text-annotation represents a "sticky note".
- link-annotation represents a hypertext link to a destination.
- URI-link-annotation represents a hypertext link to a web page.