Haru Free PDF Library
Page routines

Data Structures

struct  _HPDF_PageSizeValue
 Data structure representing page size (width and height), in points. More...
 

Typedefs

typedef struct _HPDF_PageSizeValue HPDF_PageSizeValue
 Data structure representing page size (width and height), in points. More...
 

Functions

HPDF_PageLayout HPDF_GetPageLayout (HPDF_Doc pdf)
 Return page display layout. More...
 
HPDF_STATUS HPDF_SetPageLayout (HPDF_Doc pdf, HPDF_PageLayout layout)
 Set page display layout. If attribute is not set, the setting of the viewer application is used. More...
 
HPDF_PageMode HPDF_GetPageMode (HPDF_Doc pdf)
 Return page display mode. More...
 
HPDF_STATUS HPDF_SetPageMode (HPDF_Doc pdf, HPDF_PageMode mode)
 Set document display mode. More...
 
HPDF_STATUS HPDF_SetOpenAction (HPDF_Doc pdf, HPDF_Destination open_action)
 Set the first page to appear when a document is opened. More...
 
HPDF_Page HPDF_GetCurrentPage (HPDF_Doc pdf)
 Get handle of current page object. More...
 
HPDF_Page HPDF_AddPage (HPDF_Doc pdf)
 Create new page and add it after the last page of document. More...
 
HPDF_Page HPDF_InsertPage (HPDF_Doc pdf, HPDF_Page page)
 Create new page and insert it just before specified page. More...
 
HPDF_STATUS HPDF_AddPageLabel (HPDF_Doc pdf, HPDF_UINT page_num, HPDF_PageNumStyle style, HPDF_UINT first_page, const char *prefix)
 Add page labeling range for document. More...
 
HPDF_STATUS HPDF_Page_SetWidth (HPDF_Page page, HPDF_REAL value)
 Change page width. More...
 
HPDF_STATUS HPDF_Page_SetHeight (HPDF_Page page, HPDF_REAL value)
 Change page height. More...
 
HPDF_STATUS HPDF_Page_SetSize (HPDF_Page page, HPDF_PageSizes size, HPDF_PageDirection direction)
 Change page size and direction to a predefined ones. More...
 
HPDF_STATUS HPDF_Page_SetRotate (HPDF_Page page, HPDF_UINT16 angle)
 Set rotation angle of the page. More...
 
HPDF_REAL HPDF_Page_TextWidth (HPDF_Page page, const char *text)
 Get text width in current font size, character spacing and word spacing. More...
 
HPDF_UINT HPDF_Page_MeasureText (HPDF_Page page, const char *text, HPDF_REAL width, HPDF_BOOL wordwrap, HPDF_REAL *real_width)
 Calculate byte length which can be included within the specified width. More...
 
HPDF_REAL HPDF_Page_GetWidth (HPDF_Page page)
 Get page width. More...
 
HPDF_REAL HPDF_Page_GetHeight (HPDF_Page page)
 Get page height. More...
 
HPDF_UINT16 HPDF_Page_GetGMode (HPDF_Page page)
 Get current graphics mode. More...
 
HPDF_Point HPDF_Page_GetCurrentPos (HPDF_Page page)
 Get current position for path painting. More...
 
HPDF_Point HPDF_Page_GetCurrentTextPos (HPDF_Page page)
 Get current position for text showing. More...
 
HPDF_Font HPDF_Page_GetCurrentFont (HPDF_Page page)
 Get page current font handle. More...
 
HPDF_REAL HPDF_Page_GetCurrentFontSize (HPDF_Page page)
 Get page current font size. More...
 
HPDF_TransMatrix HPDF_Page_GetTransMatrix (HPDF_Page page)
 Get page current transformation matrix. More...
 
HPDF_REAL HPDF_Page_GetLineWidth (HPDF_Page page)
 Get page current line width. More...
 
HPDF_LineCap HPDF_Page_GetLineCap (HPDF_Page page)
 Get page current line cap. More...
 
HPDF_LineJoin HPDF_Page_GetLineJoin (HPDF_Page page)
 Get page current line join. More...
 
HPDF_REAL HPDF_Page_GetMiterLimit (HPDF_Page page)
 Get page current miter limit. More...
 
HPDF_DashMode HPDF_Page_GetDash (HPDF_Page page)
 Get page current line dash pattern. More...
 
HPDF_REAL HPDF_Page_GetFlat (HPDF_Page page)
 Get page current flatness value. More...
 
HPDF_REAL HPDF_Page_GetCharSpace (HPDF_Page page)
 Get page current character spacing value. More...
 
HPDF_REAL HPDF_Page_GetWordSpace (HPDF_Page page)
 Get page current word spacing value. More...
 
HPDF_REAL HPDF_Page_GetHorizontalScalling (HPDF_Page page)
 Get page current horizontal scaling value for text showing. More...
 
HPDF_REAL HPDF_Page_GetTextLeading (HPDF_Page page)
 Get page current text leading value. More...
 
HPDF_TextRenderingMode HPDF_Page_GetTextRenderingMode (HPDF_Page page)
 Get page current text rendering mode. More...
 
HPDF_REAL HPDF_Page_GetTextRise (HPDF_Page page)
 Get page current text rise value. More...
 
HPDF_RGBColor HPDF_Page_GetRGBFill (HPDF_Page page)
 Get page current filling color value (RGB). More...
 
HPDF_RGBColor HPDF_Page_GetRGBStroke (HPDF_Page page)
 Get page current stroke color value (RGB). More...
 
HPDF_CMYKColor HPDF_Page_GetCMYKFill (HPDF_Page page)
 Get page current filling color value (CMYK). More...
 
HPDF_CMYKColor HPDF_Page_GetCMYKStroke (HPDF_Page page)
 Get page current stroke color value (CMYK). More...
 
HPDF_REAL HPDF_Page_GetGrayFill (HPDF_Page page)
 Get page current filling color value (Gray). More...
 
HPDF_REAL HPDF_Page_GetGrayStroke (HPDF_Page page)
 Get page current stroke color value (Gray). More...
 
HPDF_ColorSpace HPDF_Page_GetStrokingColorSpace (HPDF_Page page)
 Get page current stroke color space. More...
 
HPDF_ColorSpace HPDF_Page_GetFillingColorSpace (HPDF_Page page)
 Get page current filling color space. More...
 
HPDF_TransMatrix HPDF_Page_GetTextMatrix (HPDF_Page page)
 Get page current text transformation matrix. More...
 
HPDF_UINT HPDF_Page_GetGStateDepth (HPDF_Page page)
 Get page current graphics state stack depth. More...
 
HPDF_STATUS HPDF_Page_New_Content_Stream (HPDF_Page page, HPDF_Dict *new_stream)
 Create new content stream on the page. More...
 
HPDF_STATUS HPDF_Page_Insert_Shared_Content_Stream (HPDF_Page page, HPDF_Dict shared_stream)
 Insert content stream to the page. More...
 
HPDF_STATUS HPDF_Page_SetSlideShow (HPDF_Page page, HPDF_TransitionStyle type, HPDF_REAL disp_time, HPDF_REAL trans_time)
 Configure slide transition of the page. More...
 
HPDF_STATUS HPDF_Page_RawWrite (HPDF_Page page, char *data)
 Write raw commands to page stream This command allow user to write some data to page stream unconditionally. More...
 

Detailed Description

Page routines are functions for page creation, styling, text setup, line setup and so on.

Typedef Documentation

◆ HPDF_PageSizeValue

Data structure representing page size (width and height), in points.

Function Documentation

◆ HPDF_AddPage()

HPDF_Page HPDF_AddPage ( HPDF_Doc  pdf)

◆ HPDF_AddPageLabel()

HPDF_STATUS HPDF_AddPageLabel ( HPDF_Doc  pdf,
HPDF_UINT  page_num,
HPDF_PageNumStyle  style,
HPDF_UINT  first_page,
const char *  prefix 
)

Add page labeling range for document.

The page label is shown in the thumbnails view.

Parameters
pdfDocument object handle.
page_numFirst page applies labeling range
style

One of the following numbering styles:

first_pageFirst page number to use
prefixPrefix for the page label (NULL is allowed.)
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
Sample
HPDF_STATUS HPDF_AddPageLabel(HPDF_Doc pdf, HPDF_UINT page_num, HPDF_PageNumStyle style, HPDF_UINT first_page, const char *prefix)
Add page labeling range for document.
@ HPDF_PAGE_NUM_STYLE_DECIMAL
Definition: hpdf_types.h:373
@ HPDF_PAGE_NUM_STYLE_LOWER_ROMAN
Definition: hpdf_types.h:375
Output
Pages in document will be labeled as follows:
i, ii, iii, iv, 1, 2, 3, A-8, A-9, ...

◆ HPDF_GetCurrentPage()

HPDF_Page HPDF_GetCurrentPage ( HPDF_Doc  pdf)

Get handle of current page object.

Parameters
pdfDocument object handle.
Returns
Current page object on success, otherwise returns NULL.
Examples
jpeg_demo.c, and png_demo.c.

◆ HPDF_GetPageLayout()

HPDF_PageLayout HPDF_GetPageLayout ( HPDF_Doc  pdf)

Return page display layout.

Parameters
pdfDocument object handle.
Returns
Page display layout on success. If page layout is not set, returns HPDF_PAGE_LAYOUT_EOF.

◆ HPDF_GetPageMode()

HPDF_PageMode HPDF_GetPageMode ( HPDF_Doc  pdf)

Return page display mode.

Parameters
pdfDocument object handle.
Returns
Page display mode on success.

◆ HPDF_InsertPage()

HPDF_Page HPDF_InsertPage ( HPDF_Doc  pdf,
HPDF_Page  page 
)

Create new page and insert it just before specified page.

Parameters
pdfDocument object handle.
pageSpecify page handle object to insert newly created page right before.
Returns
Handle of created HPDF_Page object on success, otherwise, returns NULL and error-handler is called.
Error codes

◆ HPDF_Page_GetCharSpace()

HPDF_REAL HPDF_Page_GetCharSpace ( HPDF_Page  page)

Get page current character spacing value.

Parameters
pagePage object handle.
Returns
Page current character spacing value on success, otherwise it returns 0.

◆ HPDF_Page_GetCMYKFill()

HPDF_CMYKColor HPDF_Page_GetCMYKFill ( HPDF_Page  page)

Get page current filling color value (CMYK).

HPDF_Page_GetCMYKFill() is valid only when the page's filling color space is HPDF_CS_DEVICE_CMYK.

Parameters
pagePage object handle.
Returns
Page current filling color value (CMYK) on success, otherwise it returns HPDF_CMYKColor{0, 0, 0, 0}.

◆ HPDF_Page_GetCMYKStroke()

HPDF_CMYKColor HPDF_Page_GetCMYKStroke ( HPDF_Page  page)

Get page current stroke color value (CMYK).

HPDF_Page_GetCMYKStroke() is valid only when the page's stroke color space is HPDF_CS_DEVICE_CMYK.

Parameters
pagePage object handle.
Returns
Page current stroke color value (CMYK) on success, otherwise it returns HPDF_CMYKColor{0, 0, 0, 0}.

◆ HPDF_Page_GetCurrentFont()

HPDF_Font HPDF_Page_GetCurrentFont ( HPDF_Page  page)

Get page current font handle.

Parameters
pagePage object handle.
Returns
Page current font handle on success, otherwise it returns NULL.
Examples
image_demo.c, and text_demo.c.

◆ HPDF_Page_GetCurrentFontSize()

HPDF_REAL HPDF_Page_GetCurrentFontSize ( HPDF_Page  page)

Get page current font size.

Parameters
pagePage object handle.
Returns
Page current font size on success, otherwise it returns 0.
Examples
text_demo.c.

◆ HPDF_Page_GetCurrentPos()

HPDF_Point HPDF_Page_GetCurrentPos ( HPDF_Page  page)

Get current position for path painting.

Application can call HPDF_Page_GetCurrentPos() only when graphics mode is HPDF_GMODE_PATH_OBJECT.

Parameters
pagePage object handle.
Returns
HPDF_Point struct with current position for path painting of the page. Otherwise it returns HPDF_Point{0, 0}.
Error codes
Examples
arc_demo.c.

◆ HPDF_Page_GetCurrentTextPos()

HPDF_Point HPDF_Page_GetCurrentTextPos ( HPDF_Page  page)

Get current position for text showing.

Application can call HPDF_Page_GetCurrentTextPos() only when graphics mode is HPDF_GMODE_TEXT_OBJECT.

Parameters
pagePage object handle.
Returns
HPDF_Point struct with current position for text showing of the page. Otherwise it returns HPDF_Point{0, 0}.
Examples
jpfont_demo.c, link_annotation.c, and text_demo2.c.

◆ HPDF_Page_GetDash()

HPDF_DashMode HPDF_Page_GetDash ( HPDF_Page  page)

Get page current line dash pattern.

Parameters
pagePage object handle.
Returns
Page current line dash pattern HPDF_DashMode for path painting on success, otherwise it returns HPDF_DashMode{{0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f}.

◆ HPDF_Page_GetFillingColorSpace()

HPDF_ColorSpace HPDF_Page_GetFillingColorSpace ( HPDF_Page  page)

Get page current filling color space.

Parameters
pagePage object handle.
Returns
Page current filling color space on success, otherwise it returns HPDF_CS_EOF.

◆ HPDF_Page_GetFlat()

HPDF_REAL HPDF_Page_GetFlat ( HPDF_Page  page)

Get page current flatness value.

Parameters
pagePage object handle.
Returns
Page current flatness value on success, otherwise it returns HPDF_DEF_FLATNESS.

◆ HPDF_Page_GetGMode()

HPDF_UINT16 HPDF_Page_GetGMode ( HPDF_Page  page)

Get current graphics mode.

Parameters
pagePage object handle.
Returns
Current graphics mode of the page on success, otherwise returns 0.

◆ HPDF_Page_GetGrayFill()

HPDF_REAL HPDF_Page_GetGrayFill ( HPDF_Page  page)

Get page current filling color value (Gray).

HPDF_Page_GetGrayFill() is valid only when the page's filling color space is HPDF_CS_DEVICE_GRAY.

Parameters
pagePage object handle.
Returns
Page current filling color value (Gray) on success, otherwise it returns 0.

◆ HPDF_Page_GetGrayStroke()

HPDF_REAL HPDF_Page_GetGrayStroke ( HPDF_Page  page)

Get page current stroke color value (Gray).

HPDF_Page_GetGrayStroke() is valid only when the page's stroke color space is HPDF_CS_DEVICE_GRAY.

Parameters
pagePage object handle.
Returns
Page current stroke color value (Gray) on success, otherwise it returns 0.

◆ HPDF_Page_GetGStateDepth()

HPDF_UINT HPDF_Page_GetGStateDepth ( HPDF_Page  page)

Get page current graphics state stack depth.

Parameters
pagePage object handle.
Returns
Page current graphics state stack depth on success, otherwise it returns 0.
See also
HPDF_LIMIT_MAX_GSTATE, HPDF_GState_New()

◆ HPDF_Page_GetHeight()

HPDF_REAL HPDF_Page_GetHeight ( HPDF_Page  page)

◆ HPDF_Page_GetHorizontalScalling()

HPDF_REAL HPDF_Page_GetHorizontalScalling ( HPDF_Page  page)

Get page current horizontal scaling value for text showing.

Parameters
pagePage object handle.
Returns
Page current horizontal scaling value for text showing on success, otherwise it returns HPDF_DEF_HSCALING.
Todo:
Deprecate and rename function

◆ HPDF_Page_GetLineCap()

HPDF_LineCap HPDF_Page_GetLineCap ( HPDF_Page  page)

Get page current line cap.

Parameters
pagePage object handle.
Returns
Page current line cap for path painting on success, otherwise it returns HPDF_DEF_LINECAP.

◆ HPDF_Page_GetLineJoin()

HPDF_LineJoin HPDF_Page_GetLineJoin ( HPDF_Page  page)

Get page current line join.

Parameters
pagePage object handle.
Returns
Page current line join for path painting on success, otherwise it returns HPDF_DEF_LINEJOIN.

◆ HPDF_Page_GetLineWidth()

HPDF_REAL HPDF_Page_GetLineWidth ( HPDF_Page  page)

Get page current line width.

Parameters
pagePage object handle.
Returns
Page current line width for path painting on success, otherwise it returns HPDF_DEF_LINEWIDTH.
Examples
grid_sheet.c.

◆ HPDF_Page_GetMiterLimit()

HPDF_REAL HPDF_Page_GetMiterLimit ( HPDF_Page  page)

Get page current miter limit.

Parameters
pagePage object handle.
Returns
Page current line miter limit for path painting on success, otherwise it returns HPDF_DEF_MITERLIMIT.

◆ HPDF_Page_GetRGBFill()

HPDF_RGBColor HPDF_Page_GetRGBFill ( HPDF_Page  page)

Get page current filling color value (RGB).

HPDF_Page_GetRGBFill() is valid only when the page's filling color space is HPDF_CS_DEVICE_RGB.

Parameters
pagePage object handle.
Returns
Page current filling color value (RGB) on success, otherwise it returns HPDF_RGBColor{0, 0, 0}.
Examples
text_demo.c.

◆ HPDF_Page_GetRGBStroke()

HPDF_RGBColor HPDF_Page_GetRGBStroke ( HPDF_Page  page)

Get page current stroke color value (RGB).

HPDF_Page_GetRGBStroke() is valid only when the page's stroke color space is HPDF_CS_DEVICE_RGB.

Parameters
pagePage object handle.
Returns
Page current stroke color value (RGB) on success, otherwise it returns HPDF_RGBColor{0, 0, 0}.

◆ HPDF_Page_GetStrokingColorSpace()

HPDF_ColorSpace HPDF_Page_GetStrokingColorSpace ( HPDF_Page  page)

Get page current stroke color space.

Parameters
pagePage object handle.
Returns
Page current stroke color space on success, otherwise it returns HPDF_CS_EOF.

◆ HPDF_Page_GetTextLeading()

HPDF_REAL HPDF_Page_GetTextLeading ( HPDF_Page  page)

Get page current text leading value.

Parameters
pagePage object handle.
Returns
Page current text leading value on success, otherwise it returns 0.

◆ HPDF_Page_GetTextMatrix()

HPDF_TransMatrix HPDF_Page_GetTextMatrix ( HPDF_Page  page)

Get page current text transformation matrix.

Parameters
pagePage object handle.
Returns
Page current HPDF_TransMatrix on success, otherwise it returns HPDF_TransMatrix{1, 0, 0, 1, 0, 0}.

◆ HPDF_Page_GetTextRenderingMode()

HPDF_TextRenderingMode HPDF_Page_GetTextRenderingMode ( HPDF_Page  page)

Get page current text rendering mode.

Parameters
pagePage object handle.
Returns
Page current text rendering mode on success, otherwise it returns 0.

◆ HPDF_Page_GetTextRise()

HPDF_REAL HPDF_Page_GetTextRise ( HPDF_Page  page)

Get page current text rise value.

Parameters
pagePage object handle.
Returns
Page current text rise value on success, otherwise it returns 0.

◆ HPDF_Page_GetTransMatrix()

HPDF_TransMatrix HPDF_Page_GetTransMatrix ( HPDF_Page  page)

Get page current transformation matrix.

Parameters
pagePage object handle.
Returns
Page current transfomation matrix HPDF_TransMatrix on success, otherwise it returns default transformation matrix HPDF_TransMatrix{1, 0, 0, 1, 0, 0}.
See also
HPDF_Page_Concat()

◆ HPDF_Page_GetWidth()

HPDF_REAL HPDF_Page_GetWidth ( HPDF_Page  page)

Get page width.

Parameters
pagePage object handle.
Returns
Page width on success, otherwise returns 0.
Examples
attach.c, clip_hatch.c, clip_hatch2.c, encryption.c, font_demo.c, grid_sheet.c, line_demo.c, pattern.c, pattern2.c, permission.c, and text_demo.c.

◆ HPDF_Page_GetWordSpace()

HPDF_REAL HPDF_Page_GetWordSpace ( HPDF_Page  page)

Get page current word spacing value.

Parameters
pagePage object handle.
Returns
Page current word spacing value on success, otherwise it returns 0.

◆ HPDF_Page_Insert_Shared_Content_Stream()

HPDF_STATUS HPDF_Page_Insert_Shared_Content_Stream ( HPDF_Page  page,
HPDF_Dict  shared_stream 
)

Insert content stream to the page.

Parameters
pagePage object handle.
shared_streamReference to HPDF_Dict, previously created by HPDF_Page_New_Content_Stream()
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_Insert_Shared_Content_Stream()

◆ HPDF_Page_MeasureText()

HPDF_UINT HPDF_Page_MeasureText ( HPDF_Page  page,
const char *  text,
HPDF_REAL  width,
HPDF_BOOL  wordwrap,
HPDF_REAL real_width 
)

Calculate byte length which can be included within the specified width.

Parameters
pagePage object handle.
textText to get width
widthWidth of the area to put text.
wordwrapWord wrap flag. When there are three words of "ABCDE", "FGH", and "IJKL", and the substring until "J" can be included within the width, if word_wrap parameter is HPDF_FALSE it returns 12, and if word_wrap parameter is HPDF_TRUE, it returns 10 (the end of the previous word).
real_widthIf this parameter is not NULL, the real widths of the text is set. An application can set it to NULL, if it is unnecessary.
Returns
Byte length which can be included within the specified width in current font size, character spacing and word spacing. Otherwise it returns 0 and calls error handler.
Todo:
Check if function return byte length or character lenght, it differs in multiple cases.
Error codes
Examples
text_demo.c.

◆ HPDF_Page_New_Content_Stream()

HPDF_STATUS HPDF_Page_New_Content_Stream ( HPDF_Page  page,
HPDF_Dict new_stream 
)

Create new content stream on the page.

The call can return a reference to the new content stream in new_stream. This reference can be used on a later pages to call HPDF_Page_Insert_Shared_Content_Stream().

The use case is when you need to place a considerable amount of identical content on multiple pages. On the first occurrence of the content, call HPDF_Page_New_Content_Stream() before you start creating the content in order to place the content in a separate stream. Call HPDF_Page_New_Content_Stream() again after you have finished the content. Then, on subsequent pages, call HPDF_Page_Insert_Shared_Content_Stream() to place the content on that page.

Parameters
pagePage object handle.
new_streamReference to HPDF_Dict identifying new stream.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_Insert_Shared_Content_Stream()

◆ HPDF_Page_RawWrite()

HPDF_STATUS HPDF_Page_RawWrite ( HPDF_Page  page,
char *  data 
)

Write raw commands to page stream This command allow user to write some data to page stream unconditionally.

Parameters
pagePage object handle.
dataData to be written to page stream
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
Warning
This command is dangerous! Use it with caution, library does not validate input.
Examples
pattern2.c.

◆ HPDF_Page_SetHeight()

HPDF_STATUS HPDF_Page_SetHeight ( HPDF_Page  page,
HPDF_REAL  value 
)

Change page height.

Parameters
pagePage object handle.
valueNew page height. Valid values are between 3 and 14400.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
Examples
arc_demo.c, character_map.c, chfont_demo.c, encoding_list.c, ext_gstate_demo.c, grid_demo.c, image_demo.c, jpeg_demo.c, jpfont_demo.c, link_annotation.c, outline_demo.c, outline_demo_jp.c, png_demo.c, raw_image_demo.c, slide_show_demo.c, text_annotation.c, ttfont_demo.c, and ttfont_demo_jp.c.

◆ HPDF_Page_SetRotate()

HPDF_STATUS HPDF_Page_SetRotate ( HPDF_Page  page,
HPDF_UINT16  angle 
)

Set rotation angle of the page.

Parameters
pagePage object handle.
angleSpecify the rotation angle of the page. It must be a multiple of 90 degrees.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes

◆ HPDF_Page_SetSize()

HPDF_STATUS HPDF_Page_SetSize ( HPDF_Page  page,
HPDF_PageSizes  size,
HPDF_PageDirection  direction 
)

Change page size and direction to a predefined ones.

Parameters
pagePage object handle.
sizeSpecify a predefined page size value. See _HPDF_PageSizes.
directionSpecify the direction of the page.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
Examples
attach.c, clip_hatch.c, clip_hatch2.c, encryption.c, matrix.c, minimal.c, page_sizes_demo.c, pattern.c, pattern2.c, permission.c, text_demo2.c, transforms.c, and utf8.c.

◆ HPDF_Page_SetSlideShow()

HPDF_STATUS HPDF_Page_SetSlideShow ( HPDF_Page  page,
HPDF_TransitionStyle  type,
HPDF_REAL  disp_time,
HPDF_REAL  trans_time 
)

Configure slide transition of the page.

Parameters
pagePage object handle.
typeThe transition style. See HPDF_TransitionStyle.
disp_timePage display duration (in seconds).
trans_timeTransition effect duration (in seconds). Default is 1 second.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Examples
slide_show_demo.c.

◆ HPDF_Page_SetWidth()

HPDF_STATUS HPDF_Page_SetWidth ( HPDF_Page  page,
HPDF_REAL  value 
)

Change page width.

Parameters
pagePage object handle.
valueNew page width. Valid values are between 3 and 14400.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
Examples
arc_demo.c, character_map.c, chfont_demo.c, encoding_list.c, ext_gstate_demo.c, grid_demo.c, image_demo.c, jpeg_demo.c, jpfont_demo.c, link_annotation.c, outline_demo.c, outline_demo_jp.c, png_demo.c, raw_image_demo.c, slide_show_demo.c, text_annotation.c, ttfont_demo.c, and ttfont_demo_jp.c.

◆ HPDF_Page_TextWidth()

HPDF_REAL HPDF_Page_TextWidth ( HPDF_Page  page,
const char *  text 
)

Get text width in current font size, character spacing and word spacing.

Parameters
pagePage object handle.
textText to get width
Returns
Text width in current font size, character spacing and word spacing. Otherwise it returns 0 and calls error handler.
Error codes
Examples
attach.c, character_map.c, encoding_list.c, encryption.c, font_demo.c, image_demo.c, line_demo.c, permission.c, text_demo.c, ttfont_demo.c, and ttfont_demo_jp.c.

◆ HPDF_SetOpenAction()

HPDF_STATUS HPDF_SetOpenAction ( HPDF_Doc  pdf,
HPDF_Destination  open_action 
)

Set the first page to appear when a document is opened.

Parameters
pdfDocument object handle.
open_actionSet a valid destination object.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
Examples
image_demo.c, jpeg_demo.c, and png_demo.c.

◆ HPDF_SetPageLayout()

HPDF_STATUS HPDF_SetPageLayout ( HPDF_Doc  pdf,
HPDF_PageLayout  layout 
)

Set page display layout. If attribute is not set, the setting of the viewer application is used.

Parameters
pdfDocument object handle.
layout

One of the following values:

Layout Description
HPDF_PAGE_LAYOUT_SINGLE Only one page is displayed
HPDF_PAGE_LAYOUT_ONE_COLUMN Display the pages in one column
HPDF_PAGE_LAYOUT_TWO_COLUMN_LEFT Display in two columns. Odd page number is displayed left
HPDF_PAGE_LAYOUT_TWO_COLUMN_RIGHT Display in two columns. Odd page number is displayed right
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes

◆ HPDF_SetPageMode()

HPDF_STATUS HPDF_SetPageMode ( HPDF_Doc  pdf,
HPDF_PageMode  mode 
)

Set document display mode.

Parameters
pdfDocument object handle.
mode

One of the following values:

Mode Description
HPDF_PAGE_MODE_USE_NONE Display the document with neither outline nor thumbnail.
HPDF_PAGE_MODE_USE_OUTLINE Display the document with outline pane.
HPDF_PAGE_MODE_USE_THUMBS Display the document with thumbnail pane.
HPDF_PAGE_MODE_FULL_SCREEN Display the document with full screen mode.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Error codes
Examples
character_map.c, encoding_list.c, jpfont_demo.c, outline_demo.c, outline_demo_jp.c, page_sizes_demo.c, and slide_show_demo.c.