Haru Free PDF Library
Links, Annotations and Destinations

Functions

HPDF_Destination HPDF_Page_CreateDestination (HPDF_Page page)
 Create new destination object for the page. More...
 
HPDF_STATUS HPDF_Destination_SetXYZ (HPDF_Destination dst, HPDF_REAL left, HPDF_REAL top, HPDF_REAL zoom)
 Define page appearance with three parameters which are left, top and zoom. More...
 
HPDF_STATUS HPDF_Destination_SetFit (HPDF_Destination dst)
 Set page appearance to display entire page within the window. More...
 
HPDF_STATUS HPDF_Destination_SetFitH (HPDF_Destination dst, HPDF_REAL top)
 Define page appearance to fit page width within the window and set top position of the page top parameter. More...
 
HPDF_STATUS HPDF_Destination_SetFitV (HPDF_Destination dst, HPDF_REAL left)
 Define page appearance to fit page height within the window and set left position of the page left parameter. More...
 
HPDF_STATUS HPDF_Destination_SetFitR (HPDF_Destination dst, HPDF_REAL left, HPDF_REAL bottom, HPDF_REAL right, HPDF_REAL top)
 Define page appearance to fit page within the rectangle specified by left, bottom, right and top. More...
 
HPDF_STATUS HPDF_Destination_SetFitB (HPDF_Destination dst)
 Define page appearance to fit page bounding box within the window. More...
 
HPDF_STATUS HPDF_Destination_SetFitBH (HPDF_Destination dst, HPDF_REAL top)
 Define page appearance to fit page bounding box width within the window and set top position of page to value of top parameter. More...
 
HPDF_STATUS HPDF_Destination_SetFitBV (HPDF_Destination dst, HPDF_REAL left)
 Define page appearance to fit page bounding box height within the window and set left position of page to value of left parameter. More...
 
HPDF_Annotation HPDF_Page_CreateTextAnnot (HPDF_Page page, HPDF_Rect rect, const char *text, HPDF_Encoder encoder)
 Create new text annotation object for the page. More...
 
HPDF_Annotation HPDF_Page_CreateLinkAnnot (HPDF_Page page, HPDF_Rect rect, HPDF_Destination dst)
 Create new link annotation object for the page. More...
 
HPDF_Annotation HPDF_Page_CreateURILinkAnnot (HPDF_Page page, HPDF_Rect rect, const char *uri)
 Create new web link annotation object for the page. More...
 
HPDF_STATUS HPDF_LinkAnnot_SetHighlightMode (HPDF_Annotation annot, HPDF_AnnotHighlightMode mode)
 Define link annotation mouse click appearance. More...
 
HPDF_STATUS HPDF_LinkAnnot_SetBorderStyle (HPDF_Annotation annot, HPDF_REAL width, HPDF_UINT16 dash_on, HPDF_UINT16 dash_off)
 Define link annotation border style. More...
 
HPDF_STATUS HPDF_TextAnnot_SetIcon (HPDF_Annotation annot, HPDF_AnnotIcon icon)
 Define link annotation icon. More...
 
HPDF_STATUS HPDF_TextAnnot_SetOpened (HPDF_Annotation annot, HPDF_BOOL opened)
 Define whether link annotation is initially opened. More...
 
HPDF_STATUS HPDF_Annotation_SetBorderStyle (HPDF_Annotation annot, HPDF_BSSubtype subtype, HPDF_REAL width, HPDF_UINT16 dash_on, HPDF_UINT16 dash_off, HPDF_UINT16 dash_phase)
 Define text annotation border appearance. More...
 

Detailed Description

Routines for processing navigation things

Function Documentation

◆ HPDF_Annotation_SetBorderStyle()

HPDF_STATUS HPDF_Annotation_SetBorderStyle ( HPDF_Annotation  annot,
HPDF_BSSubtype  subtype,
HPDF_REAL  width,
HPDF_UINT16  dash_on,
HPDF_UINT16  dash_off,
HPDF_UINT16  dash_phase 
)

Define text annotation border appearance.

Parameters
annotAnnotation object handle.
subtypeBorder style subtype. See _HPDF_BSSubtype.
widthAnnotation border width
dash_on,dash_off,dash_phaseDash style
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
See also
_HPDF_BSSubtype

◆ HPDF_Destination_SetFit()

HPDF_STATUS HPDF_Destination_SetFit ( HPDF_Destination  dst)

Set page appearance to display entire page within the window.

Parameters
dstDestination object handle.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
Examples
slide_show_demo.c.

◆ HPDF_Destination_SetFitB()

HPDF_STATUS HPDF_Destination_SetFitB ( HPDF_Destination  dst)

Define page appearance to fit page bounding box within the window.

Parameters
dstDestination object handle.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes

◆ HPDF_Destination_SetFitBH()

HPDF_STATUS HPDF_Destination_SetFitBH ( HPDF_Destination  dst,
HPDF_REAL  top 
)

Define page appearance to fit page bounding box width within the window and set top position of page to value of top parameter.

Parameters
dstDestination object handle.
topTop coordinate of the page.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes

◆ HPDF_Destination_SetFitBV()

HPDF_STATUS HPDF_Destination_SetFitBV ( HPDF_Destination  dst,
HPDF_REAL  left 
)

Define page appearance to fit page bounding box height within the window and set left position of page to value of left parameter.

Parameters
dstDestination object handle.
leftLeft coordinate of the page.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes

◆ HPDF_Destination_SetFitH()

HPDF_STATUS HPDF_Destination_SetFitH ( HPDF_Destination  dst,
HPDF_REAL  top 
)

Define page appearance to fit page width within the window and set top position of the page top parameter.

Parameters
dstDestination object handle.
topTop coordinate of the page.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes

◆ HPDF_Destination_SetFitR()

HPDF_STATUS HPDF_Destination_SetFitR ( HPDF_Destination  dst,
HPDF_REAL  left,
HPDF_REAL  bottom,
HPDF_REAL  right,
HPDF_REAL  top 
)

Define page appearance to fit page within the rectangle specified by left, bottom, right and top.

Parameters
dstDestination object handle.
leftLeft coordinate of the page.
bottomBottom coordinate of the page.
rightRight coordinate of the page.
topTop coordinate of the page.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes

◆ HPDF_Destination_SetFitV()

HPDF_STATUS HPDF_Destination_SetFitV ( HPDF_Destination  dst,
HPDF_REAL  left 
)

Define page appearance to fit page height within the window and set left position of the page left parameter.

Parameters
dstDestination object handle.
leftLeft coordinate of the page.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes

◆ HPDF_Destination_SetXYZ()

HPDF_STATUS HPDF_Destination_SetXYZ ( HPDF_Destination  dst,
HPDF_REAL  left,
HPDF_REAL  top,
HPDF_REAL  zoom 
)

Define page appearance with three parameters which are left, top and zoom.

Parameters
dstDestination object handle.
leftThe left coordinate of the page.
topThe top coordinate of the page.
zoomThe page magnified factor. Value must be between 0.08 (8%) to 32 (3200%).
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
Examples
encoding_list.c, image_demo.c, jpeg_demo.c, outline_demo.c, outline_demo_jp.c, page_sizes_demo.c, and png_demo.c.

◆ HPDF_LinkAnnot_SetBorderStyle()

HPDF_STATUS HPDF_LinkAnnot_SetBorderStyle ( HPDF_Annotation  annot,
HPDF_REAL  width,
HPDF_UINT16  dash_on,
HPDF_UINT16  dash_off 
)

Define link annotation border style.

Parameters
annotAnnotation object handle.
widthAnnotation border width
dash_on,dash_offDash style parameters
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
Examples
link_annotation.c, and slide_show_demo.c.

◆ HPDF_LinkAnnot_SetHighlightMode()

HPDF_STATUS HPDF_LinkAnnot_SetHighlightMode ( HPDF_Annotation  annot,
HPDF_AnnotHighlightMode  mode 
)

Define link annotation mouse click appearance.

Parameters
annotAnnotation object handle.
modeLink annotation highlight mode.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
See also
_HPDF_AnnotHighlightMode
Examples
link_annotation.c, and slide_show_demo.c.

◆ HPDF_Page_CreateDestination()

HPDF_Destination HPDF_Page_CreateDestination ( HPDF_Page  page)

Create new destination object for the page.

Parameters
pagePage object handle.
Returns
New destination object handle. If it failed, it returns NULL.
Error codes
Examples
character_map.c, encoding_list.c, image_demo.c, jpeg_demo.c, jpfont_demo.c, link_annotation.c, outline_demo.c, outline_demo_jp.c, page_sizes_demo.c, png_demo.c, and slide_show_demo.c.

◆ HPDF_Page_CreateLinkAnnot()

HPDF_Annotation HPDF_Page_CreateLinkAnnot ( HPDF_Page  page,
HPDF_Rect  rect,
HPDF_Destination  dst 
)

Create new link annotation object for the page.

Parameters
pagePage object handle.
rectRectangle clickable area.
dstHandle of destination object to jump to.
Returns
New annotation object handle. If it fails, it returns NULL.
Error codes
Examples
link_annotation.c, and slide_show_demo.c.

◆ HPDF_Page_CreateTextAnnot()

HPDF_Annotation HPDF_Page_CreateTextAnnot ( HPDF_Page  page,
HPDF_Rect  rect,
const char *  text,
HPDF_Encoder  encoder 
)

Create new text annotation object for the page.

Parameters
pagePage object handle.
rectRectangle where annotation is displayed.
textText to be displayed.
encoderEncoder handle which is used to encode text. If it is NULL, PDFDocEncoding is used.
Returns
New annotation object handle. If it failed, it returns NULL.
Todo:
Clarify what PDFDocEncoding is.
Error codes
Examples
text_annotation.c.

◆ HPDF_Page_CreateURILinkAnnot()

HPDF_Annotation HPDF_Page_CreateURILinkAnnot ( HPDF_Page  page,
HPDF_Rect  rect,
const char *  uri 
)

Create new web link annotation object for the page.

Parameters
pagePage object handle.
rectRectangle of clickable area.
uriDestination URI to jump to.
Returns
New annotation object handle. If it fails, it returns NULL.
Error codes
Examples
link_annotation.c.

◆ HPDF_TextAnnot_SetIcon()

HPDF_STATUS HPDF_TextAnnot_SetIcon ( HPDF_Annotation  annot,
HPDF_AnnotIcon  icon 
)

Define link annotation icon.

Parameters
annotAnnotation object handle.
iconLink annotation icon type.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
See also
_HPDF_AnnotIcon
Examples
text_annotation.c.

◆ HPDF_TextAnnot_SetOpened()

HPDF_STATUS HPDF_TextAnnot_SetOpened ( HPDF_Annotation  annot,
HPDF_BOOL  opened 
)

Define whether link annotation is initially opened.

Parameters
annotAnnotation object handle.
openedHPDF_TRUE if annotation initially displayed open.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
Examples
text_annotation.c.