home | download | documentation | examples | sourceforge | forums

## Graphics

### HPDF_Page_SetLineWidth

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetLineWidth (HPDF_Page page,
HPDF_REAL line_width);

#### Description

HPDF_Page_SetLineWidth() sets the width of the line used to stroke a path.
An application can invoke HPDF_Page_SetLineWidth() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
line_width
The width of line.

#### Returns

When HPDF_Page_SetLineWidth() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetLineCap

#include "apdf.h"
HPDF_Page_SetLineCap (HPDF_Page page,
HPDF_LineCap line_cap);

#### Description

HPDF_Page_SetLineCap() sets the shape to be used at the ends of line.
An application can invoke HPDF_Page_SetLineCap() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
line_cap
The style of line-cap.

value |  | description
HPDF_BUTT_END |  | The line is squared off at the endpoint of the path.
HPDF_ROUND_END |  | The end of a line becomes a semicircle whose center is the end point of the path.
HPDF_PROJECTING_SCUARE_END |  | The line continues to the point that exceeds half of the stroke width the end point.

#### Returns

When HPDF_Page_SetLineCap() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetLineJoin

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetLineJoin (HPDF_Page page,
HPDF_LineJoin line_join);

#### Description

HPDF_Page_SetLineJoin() Sets the line join style in the page.
An application can invoke HPDF_Page_SetLineJoin() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
line_join
The style of line-join.

value | sample
HPDF_MITER_JOIN |
HPDF_ROUND_JOIN |
HPDF_BEVEL_JOIN |

#### Returns

When HPDF_Page_SetLineJoin() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetMiterLimit

### HPDF_Page_SetDash

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetDash (HPDF_Page page,
const HPDF_UINT16 *dash_ptn,
HPDF_UINT num_param,
HPDF_UINT phase);

#### Description

HPDF_Page_SetDash() Sets the line dash pattern in the page.
An application can invoke HPDF_Page_SetDash() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.
Sample of the dash pattern.

- dash_ptn=NULL, num_pattern = 0, phase=0

- dash_ptn=[3], num_pattern = 1, phase=1

- dash_ptn=[7, 3], num_pattern = 2, phase=2

- dash_ptn=[8, 7, 2, 7], num_pattern = 4, phase=0

#### Parameter

page
The handle of a page object.
dash_pattern
An array of HPDF_UINT16 which specify pattern of dashes and gaps used to stroke paths.
num_param
The number of the element of the dash_pattern. Admitted ranges are from 0 to 8.
phase
The phase in which the pattern begins.

#### Returns

When HPDF_Page_SetDash() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_

### HPDF_Page_SetExtGState

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetExtGState (HPDF_Page page,
HPDF_ExtGState ext_gstate);

#### Description

HPDF_Page_SetExtGState() applys the graphics state to the page.
An application can invoke HPDF_Page_GSave() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.
ext_gstate
The handle of a extended graphics state object.

#### Returns

When HPDF_Page_SetExtGState() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_GSave

#include "apdf.h"
HPDF_STATUS
HPDF_Page_GSave (HPDF_Page page);

#### Description

HPDF_Page_GSave() saves the page's current graphics parameter to the stack. An application can invoke HPDF_Page_GSave() up to 28 and can restore the saved parameter by invoking HPDF_Page_GRestore().
The parameters that are saved by HPDF_Page_GSave() is as follows.

- Transformation Matrix
- Line Width
- Line Cap Style
- Line Join Style
- Miter Limit
- Dash Mode
- Flatness
- Character Spacing
- Word Spacing
- Horizontal Scalling
- Text Leading
- Rendering Mode
- Text Rise
- Filling Color
- Stroking Color
- Font
- Font Size

An application can invoke HPDF_Page_GSave() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_GSave() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_GRestore

#include "apdf.h"
HPDF_STATUS
HPDF_Page_GRestore (HPDF_Page page);

#### Description

HPDF_Page_GRestore() restore the graphics state which is saved by HPDF_Page_GSave().
An application can invoke HPDF_Page_GSave() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_GRestore() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_Concat

#include "apdf.h"
HPDF_STATUS
HPDF_Page_Concat (HPDF_Page page,
HPDF_REAL a,
HPDF_REAL b,
HPDF_REAL c,
HPDF_REAL d,
HPDF_REAL x,
HPDF_REAL y);

#### Description

HPDF_Page_Concat() concatenates the page's current transformation matrix and specified matrix.
For example, if you want to rotate the coordinate system of the page by 45 degrees, use HPDF_Page_Concat() as follows.
float rad1 = 45 / 180 * 3.141592;
HPDF_Page_Concat (page, cos(rad1), sin(rad1), -sin(rad1),
cos(rad1), 220, 350);
Additionally to change the coordinate system of the page to 300dpi, use HPDF_Page_Concat() as follows.
HPDF_Page_Concat (page, 72.0f / 300.0f, 0, 0, 72.0f / 300.0f, 0, 0);
Invoke HPDF_Page_GSave() before HPDF_Page_Concat(). Then the change by HPDF_Page_Concat() can be restored by invoking HPDF_Page_GRestore().
/* save the current graphics states */
HPDF_Page_GSave (page);
/* concatenate the transformation matrix */
HPDF_Page_Concat (page, 72.0f / 300.0f, 0, 0, 72.0f / 300.0f, 0, 0);
/* show text on the translated coordinates */
HPDF_Page_BeginText (page);
HPDF_Page_MoveTextPos (page, 50, 100);
HPDF_Page_ShoeText (page, "Text on the translated coordinates");
HPDF_Page_EndText (page);
/* restore the graphics states */
HPDF_Page_GRestore (page);
An application can invoke HPDF_Page_GSave() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.
a, b, c, d, x, y
The transformation matrix to concatenate.

#### Returns

When HPDF_Page_Concat() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_MoveTo

#include "apdf.h"
HPDF_STATUS
HPDF_Page_MoveTo (HPDF_Page page,
HPDF_REAL x,
HPDF_REAL y);

#### Description

HPDF_Page_MoveTo() starts a new subpath and move the current point for drawing path, HPDF_Page_MoveTo() sets the start point for the path to the point (x, y) and changes the graphics mode to HPDF_GMODE_PATH_OBJECT.
An application can invoke HPDF_Page_MoveTo() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_PATH_OBJECT.

#### Parameter

page
The handle of a page object.
x, y
The start point for drawing path

#### Returns

When HPDF_Page_MoveTo() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_LineTo

#include "apdf.h"
HPDF_STATUS
HPDF_Page_LineTo (HPDF_Page page,
HPDF_REAL x,
HPDF_REAL y);

#### Description

HPDF_Page_LineTo() appends a path from the current point to the specified point.
An application can invoke HPDF_Page_LineTo() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT.

#### Parameter

page
The handle of a page object.
x, y
The end point of the path

#### Returns

When HPDF_Page_LineTo() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_CurveTo

#include "apdf.h"
HPDF_STATUS
HPDF_Page_CurveTo (HPDF_Page page,
HPDF_REAL x1,
HPDF_REAL y1,
HPDF_REAL x2,
HPDF_REAL y2,
HPDF_REAL x3,
HPDF_REAL y3);

#### Description

HPDF_Page_CurveTo() appends a Bézier curve to the current path using two spesified points.
The point (x1, y1) and the point (x2, y2) are used as the control points for a Bézier curve and current point is moved to the point (x3, y3)
An application can invoke HPDF_Page_CurveTo() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT.

#### Parameter

page
The handle of a page object.
x1, y1, x2, y2, x3, y3
The control points for a Bézier curve.

#### Returns

When HPDF_Page_CurveTo() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_CurveTo2

#include "apdf.h"
HPDF_STATUS
HPDF_Page_CurveTo2 (HPDF_Page page,
HPDF_REAL x2,
HPDF_REAL y2,
HPDF_REAL x3,
HPDF_REAL y3);

#### Description

HPDF_Page_CurveTo2() appends a Bézier curve to the current path using two spesified points.
The current point and the point (x2, y2) are used as the control points for a Bézier curve and current point is moved to the point (x3, y3)
An application can invoke HPDF_Page_CurveTo3() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT.

#### Parameter

page
The handle of a page object.
x2, y2, x3, y3
The control points for a Bézier curve.

#### Returns

When HPDF_Page_CurveTo3() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_CurveTo3

#include "apdf.h"
HPDF_STATUS
HPDF_Page_CurveTo3 (HPDF_Page page,
HPDF_REAL x1,
HPDF_REAL y1,
HPDF_REAL x3,
HPDF_REAL y3);

#### Description

HPDF_Page_CurveTo3() appends a Bézier curve to the current path using two spesified points.
The point (x1, y1) and the point (x3, y3) are used as the control points for a Bézier curve and current point is moved to the point (x3, y3)
An application can invoke HPDF_Page_CurveTo2() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT.

#### Parameter

page
The handle of a page object.
x1, y1, x3, y3
The control points for a Bézier curve.

#### Returns

When HPDF_Page_CurveTo3() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_ClosePath

#include "apdf.h"
HPDF_STATUS
HPDF_Page_ClosePath (HPDF_Page page);

#### Description

HPDF_Page_ClosePath() appends a strait line from the current point to the start point of sub path.
The current point is moved to the start point of sub path.
An application can invoke HPDF_Page_CurveTo2() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_ClosePath() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_Rectangle

#include "apdf.h"
HPDF_STATUS
HPDF_Page_Rectangle (HPDF_Page page,
HPDF_REAL x,
HPDF_REAL y,
HPDF_REAL width,
HPDF_REAL height);

#### Description

HPDF_Page_Rectangle() appends a rectangle to the current path.
An application can invoke HPDF_Page_Rectangle() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_PATH_OBJECT.

#### Parameter

page
The handle of a page object.
x, y
The lower-left point of the rectangle.
width
The width of the rectangle.
height
The height of the rectangle.

#### Returns

When HPDF_Page_Rectangle() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_Stroke

#include "apdf.h"
HPDF_STATUS
HPDF_Page_Stroke (HPDF_Page page);

#### Description

HPDF_Page_Stroke() paints the current path.
An application can invoke HPDF_Page_Stroke() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT. And it changes the graphics mode to HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_Stroke() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_ClosePathStroke

#include "apdf.h"
HPDF_STATUS
HPDF_Page_ClosePathStroke (HPDF_Page page);

#### Description

HPDF_Page_ClosePathStroke() closes the current path, then it paints the path.
An application can invoke HPDF_Page_ClosePathStroke() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT. And it changes the graphics mode to HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_ClosePathStroke() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_Fill

#include "apdf.h"
HPDF_STATUS
HPDF_Page_Fill(HPDF_Page page);

#### Description

HPDF_Page_Fill() fills the current path using the nonzero winding number rule.
An application can invoke HPDF_Page_Fill() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT. And it changes the graphics mode to HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_Fill() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_Eofill

#include "apdf.h"
HPDF_STATUS
HPDF_Page_Eofill(HPDF_Page page);

#### Description

HPDF_Page_Eofill() fills the current path using the even-odd rule.
An application can invoke HPDF_Page_Eofill() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT. And it changes the graphics mode to HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_Eofill() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_FillStroke

#include "apdf.h"
HPDF_STATUS
HPDF_Page_FillStroke(HPDF_Page page);

#### Description

HPDF_Page_FillStroke() fills the current path using the nonzero winding number rule, then it paints the path.
An application can invoke HPDF_Page_FillStroke() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT. And it changes the graphics mode to HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_FillStroke() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_EofillStroke

#include "apdf.h"
HPDF_STATUS
HPDF_Page_EofillStroke(HPDF_Page page);

#### Description

HPDF_Page_EofillStroke() fills the current path using the even-odd rule, then it paints the path.
An application can invoke HPDF_Page_EofillStroke() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT. And it changes the graphics mode to HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_EofillStroke() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_ClosePathFillStroke

#include "apdf.h"
HPDF_STATUS
HPDF_Page_ClosePathFillStroke(HPDF_Page page);

#### Description

HPDF_Page_ClosePathFillStroke() closes the current path, fills the current path using the nonzero winding number rule, then it paints the path.
An application can invoke HPDF_Page_ClosePathFillStroke() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT. And it changes the graphics mode to HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_ClosePathFillStroke() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_ClosePathEofillStroke

#include "apdf.h"
HPDF_STATUS
HPDF_Page_ClosePathEoillStroke(HPDF_Page page);

#### Description

HPDF_Page_ClosePathEofillStroke() closes the current path, fills the current path using the even-odd rule, then it paints the path.
An application can invoke HPDF_Page_ClosePathEofillStroke() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT. And it changes the graphics mode to HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_ClosePathEofillStroke() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_EndPath

#include "apdf.h"
HPDF_STATUS
HPDF_Page_EndPath(HPDF_Page page);

#### Description

HPDF_Page_EndPath() ends the path object without filling and painting operation.
An application can invoke HPDF_Page_EndPath() when the graphics mode of the page is in HPDF_GMODE_PATH_OBJECT. And it changes the graphics mode to HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_EndPath() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_Clip

### HPDF_Page_Eoclip

### HPDF_Page_BeginText

#include "apdf.h"
HPDF_STATUS
HPDF_Page_BeginText(HPDF_Page page);

#### Description

HPDF_Page_BeginText() begins a text object and sets the current text position to the point (0, 0).
An application can invoke HPDF_Page_BeginText() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION. And it changes the graphics mode to HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_BeginText() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_EndText

#include "apdf.h"
HPDF_STATUS
HPDF_Page_EndText(HPDF_Page page);

#### Description

HPDF_Page_EndText() ends a text object.
An application can invoke HPDF_Page_EndText() when the graphics mode of the page is in HPDF_GMODE_TEXT_OBJECT. And it changes the graphics mode to HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.

#### Returns

When HPDF_Page_EndText() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetCharSpace

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetCharSpace (HPDF_Page page,
HPDF_REAL value);

#### Description

HPDF_Page_SetCharSpace() sets the character spacing for text showing.
The initial value of character spacing is 0.
An application can invoke HPDF_Page_SetCharSpace() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
value
The value of character spacing.

#### Returns

When HPDF_Page_SetCharSpace() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetWordSpace

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetWordSpace (HPDF_Page page,
HPDF_REAL value);

#### Description

HPDF_Page_SetWordSpace() sets the word spacing for text showing.
The initial value of word spacing is 0.
An application can invoke HPDF_Page_SetWordSpace() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
value
The value of word spacing.

#### Returns

When HPDF_Page_SetWordSpace() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetHorizontalScalling

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetHorizontalScalling (HPDF_Page page,
HPDF_REAL value);

#### Description

HPDF_Page_SetHorizontalScalling() sets the horizontal scalling for text showing.
The initial value of horizontal scalling is 100.
An application can invoke HPDF_Page_SetHorizontalScalling() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
value
The value of horizontal scalling.

#### Returns

When HPDF_Page_SetHorizontalScalling() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetTextLeading

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetTextLeading (HPDF_Page page,
HPDF_REAL value);

#### Description

HPDF_Page_SetTextLeading() sets the text leading (line spacing) for text showing.
The initial value of leading is 0.
An application can invoke HPDF_Page_SetTextLeading() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
value
The value of text leading.

#### Returns

When HPDF_Page_SetTextLeading() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetFontAndSize

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetFontAndSize (HPDF_Page page,
HPDF_Font font,
HPDF_REAL size);

#### Description

HPDF_Page_SetFontAndSize() sets the type of font and size leading.
An application can invoke HPDF_Page_SetFontAndSize() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
font
The handle of a font object.
size
The size of a font.

#### Returns

When HPDF_Page_SetFontAndSize() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetTextRenderingMode

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetTextRenderingMode (HPDF_Page page,
HPDF_TextRenderingMode mode);

#### Description

HPDF_Page_SetTextRenderingMode() sets the text rendering mode.
The initial value of text rendering mode is HPDF_FILL.
An application can invoke HPDF_Page_SetTextRenderingMode() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
mode
The text rendering mode (one of the following values)

VALUE | SAMPLE
HPDF_FILL |
HPDF_STROKE |
HPDF_FILL_THEN_STROKE |
HPDF_INVISIBLE |
HPDF_FILL_CLIPPING |
HPDF_STROKE_CLIPPING |
HPDF_FILL_STROKE_CLIPPING |
HPDF_CLIPPING |

#### Returns

When HPDF_Page_SetTextRenderingMode() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetTextRise

### HPDF_Page_MoveTextPos

#include "apdf.h"
HPDF_STATUS
HPDF_Page_MoveTextPos (HPDF_Page page,
HPDF_REAL x,
HPDF_REAL y);

#### Description

HPDF_Page_MoveTextPos() moves the current text position to the start of the next line with using specified offset values. If the start position of the current line is (x1, y1), the start of the next line is (x1 + x, y1 + y).
An application can invoke HPDF_MoveTextPos() when the graphics mode of the page is in HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
xpos, ypos
The offset of the start of the next line.
text
The text to show.

#### Returns

When HPDF_Page_MoveTextPos() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_MoveTextPos2

#include "apdf.h"
HPDF_STATUS
HPDF_Page_MoveTextPos2 (HPDF_Page page,
HPDF_REAL x,
HPDF_REAL y);

#### Description

HPDF_Page_MoveTextPos2() moves the current text position to the start of the next line with using specified offset values, and sets the text-leading to -y. If the start position of the current line is (x1, y1), the start of the next line is (x1 + x, y1 + y).
An application can invoke HPDF_MoveTextPos2() when the graphics mode of the page is in HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
xpos, ypos
The offset of the start of the next line.
text
The text to show.

#### Returns

When HPDF_Page_MoveTextPos2() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetTextMatrix

### HPDF_Page_MoveToNextLine

#include "apdf.h"
HPDF_STATUS
HPDF_Page_MoveToNextLine (HPDF_Page page);

#### Description

HPDF_Page_MoveTextPos2() moves the current text position to the start of the next line. If the start position of the current line is (x1, y1), the start of the next line is (x1, y1 - text leading).
An application can invoke HPDF_MoveTextPos2() when the graphics mode of the page is in HPDF_GMODE_TEXT_OBJECT.
NOTE:
Since the default value of Text Leading is 0, an application have to invoke HPDF_Page_SetTextLeading() before HPDF_Page_MoveTextPos2() to set text leading.

#### Parameter

page
The handle of a page object.
xpos, ypos
The offset of the start of the next line.
text
The text to show.

#### Returns

When HPDF_Page_MoveTextPos2() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_ShowText

#include "apdf.h"
HPDF_STATUS
HPDF_Page_ShowText (HPDF_Page page,
const char *text)

#### Description

HPDF_Page_ShowText() prints the text at the current position on the page.
An application can invoke HPDF_Page_ShowText() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
text
The text to print.

#### Returns

When HPDF_Page_ShowText() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_ShowTextNextLine

#include "apdf.h"
HPDF_STATUS
HPDF_Page_ShowTextNextLine (HPDF_Page page,
const char *text)

#### Description

HPDF_Page_ShowTextNextLine() moves the current text position to the start of the next line, then prints the text at the current position on the page.
An application can invoke HPDF_Page_ShowTextNextLine() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
text
The text to print.

#### Returns

When HPDF_Page_ShowTextNextLine() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_ShowTextNextLineEx

#include "apdf.h"
HPDF_STATUS
HPDF_Page_ShowTextNextLineEx (HPDF_Page page,
HPDF_REAL word_space,
HPDF_REAL char_space,
const char *text)

#### Description

HPDF_Page_ShowTextNextLineEx() moves the current text position to the start of the next line, then sets the word spacing, character spacing and prints the text at the current position on the page.
An application can invoke HPDF_Page_ShowTextNextLine() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
text
The text to print.

#### Returns

When HPDF_Page_ShowTextNextLine() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetGrayFill

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetGrayFill (HPDF_Page page,
HPDF_REAL gray);

#### Description

HPDF_Page_SetGrayFill() sets the filling color.
An application can invoke HPDF_Page_SetGrayFill() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
value
The value of the gray level between 0 and 1.

#### Returns

When HPDF_Page_SetGrayFill() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetGrayStroke

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetGrayStroke (HPDF_Page page,
HPDF_REAL gray);

#### Description

HPDF_Page_SetGrayStroke() sets the stroking color.
An application can invoke HPDF_Page_SetGrayStroke() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
value
The value of the gray level between 0 and 1.

#### Returns

When HPDF_Page_SetGrayStroke() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetRGBFill

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetRGBFill (HPDF_Page page,
HPDF_REAL r,
HPDF_REAL g,
HPDF_REAL b)

#### Description

HPDF_Page_SetRGBFill() sets the filling color.
An application can invoke HPDF_Page_SetRGBFill() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
r, g, b
The level of each color element. They must be between 0 and 1. (See "Colors")

#### Returns

When HPDF_Page_SetRGBFill() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetRGBStroke

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetRGBStroke (HPDF_Page page,
HPDF_REAL r,
HPDF_REAL g,
HPDF_REAL b)

#### Description

HPDF_Page_SetRGBStroke() sets the stroking color.
An application can invoke HPDF_Page_SetRGBStroke() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
r, g, b
The level of each color element. They must be between 0 and 1. (See "Colors")

#### Returns

When HPDF_Page_SetRGBStroke() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetCMYKFill

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetCMYKFill (HPDF_Page page,
HPDF_REAL c,
HPDF_REAL m,
HPDF_REAL y,
HPDF_REAL k)

#### Description

HPDF_Page_SetCMYKFill() sets the filling color.
An application can invoke HPDF_Page_SetCMYKFill() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
c, m, y, k
The level of each color element. They must be between 0 and 1.

#### Returns

When HPDF_Page_SetCMYKFill() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_SetCMYKStroke

#include "apdf.h"
HPDF_STATUS
HPDF_Page_SetCMYKStroke (HPDF_Page page,
HPDF_REAL c,
HPDF_REAL m,
HPDF_REAL y,
HPDF_REAL k)

#### Description

HPDF_Page_SetCMYKStroke() sets the stroking color.
An application can invoke HPDF_Page_SetCMYKStroke() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
c, m, y, k
The level of each color element. They must be between 0 and 1.

#### Returns

When HPDF_Page_SetCMYKStroke() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_ExecuteXObject

### HPDF_Page_DrawImage

#include "apdf.h"
HPDF_STATUS
HPDF_Page_DrawImage (HPDF_Page page,
HPDF_Image image,
HPDF_REAL x,
HPDF_REAL y,
HPDF_REAL width,
HPDF_REAL height)

#### Description

HPDF_Page_DrawImage() shows an image in one operation.
An application can invoke HPDF_Page_DrawImage() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION.

#### Parameter

page
The handle of a page object.
image
The handle of an image object.
x, y
The lower-left point of the region where image is displayed.
width
The width of the region where image is displayed.
height
The width of the region where image is displayed.

#### Returns

When HPDF_Page_DrawImage() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_Circle

#include "apdf.h"
HPDF_STATUS
HPDF_Page_Circle (HPDF_Page page,
HPDF_REAL x,
HPDF_REAL y,
HPDF_REAL ray);

#### Description

HPDF_Page_Circle() appends a circle to the current path.
An application can invoke HPDF_Page_Circle() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_PATH_OBJECT.

#### Parameter

page
The handle of a page object.
x, y
The center point of the circle.
ray
The ray of the circle.

#### Returns

When HPDF_Page_Circle() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_Arc

#include "apdf.h"
HPDF_STATUS
HPDF_Page_Arc (HPDF_Page page,
HPDF_REAL x,
HPDF_REAL y,
HPDF_REAL ray,
HPDF_REAL ang1,
HPDF_REAL ang2);

#### Description

HPDF_Page_Arc() appends a circle to the current path.
An application can invoke HPDF_PageArc() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_PATH_OBJECT.

#### Parameter

page
The handle of a page object.
x, y
The center point of the circle.
ray
The ray of the circle.
ang1
The angle of the begining of the arc.
ang2
The angle of the end of the arc. It must be greater than ang1.

#### Returns

When HPDF_Page_Arc() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_Ellipse

#include "apdf.h"
HPDF_STATUS
HPDF_Page_Ellipse (HPDF_Page page,
HPDF_REAL x,
HPDF_REAL y,
HPDF_REAL xray,
HPDF_REAL yray);

#### Description

HPDF_Page_Ellipse() appends an ellipse to the current path.
An application can invoke HPDF_Page_Ellipse() when the graphics mode of the page is in HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_PATH_OBJECT.

#### Parameter

page
The handle of a page object.
x, y
The center point of the circle.
xray, yray
The radius in the x and y direction.

#### Returns

When HPDF_Page_Ellipse() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_TextOut

#include "apdf.h"
HPDF_STATUS
HPDF_Page_TextOut (HPDF_Page page,
HPDF_REAL xpos,
HPDF_REAL ypos,
const char *text);

#### Description

HPDF_Page_TextOut() prints the text on the specified position.
An application can invoke HPDF_TextOut() when the graphics mode of the page is in HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
xpos, ypos
The point position where the text is displayed.
text
The text to show.

#### Returns

When HPDF_Page_TextOut() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.

### HPDF_Page_TextRect

#include "apdf.h"
HPDF_Page_TextRect (HPDF_Page page,
HPDF_REAL left,
HPDF_REAL top,
HPDF_REAL right,
HPDF_REAL bottom,
const char *text,
HPDF_TextAlignment align,
HPDF_UINT *len);

#### Description

HPDF_Page_TextRext() TextRext() print the text inside the specified region. The characters which is not
An application can invoke HPDF_TextRect() when the graphics mode of the page is in HPDF_GMODE_TEXT_OBJECT.

#### Parameter

page
The handle of a page object.
left, top, right, bottom
Coordinates of corners of the region to output text.
text
The text to show.
align
The alignment of the text.

VALUE | DESCRIPTION
HPDF_TALIGN_LEFT | The text is aligned to left.
HPDF_TALIGN_RIGHT | The text is aligned to right.
HPDF_TALIGN_CENTER | The text is aligned to center.
HPDF_TALIGN_JUSTIFY | Add spaces between the words to justify both left and right side.

len
If this value is not NULL, The number of characters which was printed in the area is returned.

#### Returns

When HPDF_Page_TextRect() succeed, it returns HPDF_OK, Otherwise it returns error code and error-handler is invoked.