# Documentation/API/Graphics

### From libHaru.org wiki

< Documentation | API

## HPDF_Page_Arc()

    HPDF_STATUS HPDF_Page_Arc  (HPDF_Page    page,
                                HPDF_REAL    x,
                                HPDF_REAL    y,
                                HPDF_REAL    radius,
                                HPDF_REAL    ang1,
                                HPDF_REAL    ang2);

Description

HPDF_Page_Arc() appends a circle arc to the current path.

Parameters

page - The handle of a page object.
x, y - The center point of the circle.
radius - The radius 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.

Graphics Mode

Before - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_PATH_OBJECT.
After - HPDF_GMODE_PATH_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_BeginText()

    HPDF_STATUS HPDF_Page_BeginText (HPDF_Page page);

Description

HPDF_Page_BeginText() begins a text object and sets the text position to (0, 0).

Parameters

page - The handle of a page object.

Graphics Mode

Before - HPDF_GMODE_PAGE_DESCRIPTION.
After - HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

See Also

HPDF_Page_EndText()

## HPDF_Page_Circle()

    HPDF_STATUS HPDF_Page_Circle  (HPDF_Page     page,
                                   HPDF_REAL     x,
                                   HPDF_REAL     y,
                                   HPDF_REAL     radius);

Description

HPDF_Page_Circle() appends a circle to the current path.

Parameters

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

Graphics Mode

Before - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_PATH_OBJECT.
After - HPDF_GMODE_PATH_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_Clip()

Not sure what this does. If anyone has used this, please provide a description.

## HPDF_Page_ClosePath()

    HPDF_STATUS HPDF_Page_ClosePath (HPDF_Page page);

Description

HPDF_Page_ClosePath() appends a straight line from the current point to the start point of sub path. The current point is moved to the start point of sub path.

Parameters

page - The handle of a page object.

Graphics Mode

Before and after - HPDF_GMODE_PATH_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_ClosePathStroke()

    HPDF_STATUS HPDF_Page_ClosePathStroke (HPDF_Page page);

Description

HPDF_Page_ClosePathStroke() closes the current path. Then, it paints the path.

Parameters

page - The handle of a page object.

Graphics Mode

Before - HPDF_GMODE_PATH_OBJECT.
After - HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_ClosePathEofillStroke()

    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 paints the path.

Parameters

page - The handle of a page object.

Graphics Mode

Before - HPDF_GMODE_PATH_OBJECT.
After - HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_ClosePathFillStroke()

    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 paints the path.

Parameters

page - The handle of a page object.

Graphics Mode

Before - HPDF_GMODE_PATH_OBJECT.
After - HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_Concat()

    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);

To change the coordinate system of the page to 300 dpi, 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_ShowText (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.

Parameters

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

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_CurveTo()

    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 the control points (x1, y1) and (x2, y2) and (x3, y3), then sets the current point to (x3, y3).

Parameters

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

Graphics Mode

Before and after - HPDF_GMODE_PATH_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_CurveTo2()

    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 the current point and (x2, y2) and (x3, y3) as control points. Then, the current point is set to (x3, y3).

Parameters

page - The handle of a page object.
x2, y2, x3, y3 - Control points for Bézier curve, along with current point.

Graphics Mode

Before and after - HPDF_GMODE_PATH_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_CurveTo3()

    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)

Parameters

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

Graphics Mode

Before and after - HPDF_GMODE_PATH_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_DrawImage()

    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.

Parameters

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.

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_Ellipse()

    HPDF_STATUS HPDF_Page_Ellipse  (HPDF_Page   page,
                                    HPDF_REAL   x,
                                    HPDF_REAL   y,
                                    HPDF_REAL   x_radius,
                                    HPDF_REAL   y_radius);

Description

HPDF_Page_Ellipse() appends an ellipse to the current path.

Parameters

page - The handle of a page object.
x, y - The center point of the ellipse.
x_radius, y_radius - Horizontal and vertical radii of the ellipse.

Graphics Mode

Before and after - HPDF_GMODE_PATH_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_EndPath()

    HPDF_STATUS HPDF_Page_EndPath (HPDF_Page page);

Description

HPDF_Page_EndPath() ends the path object without filling or painting.

Parameters

page - The handle of a page object.

Graphics Mode

Before - HPDF_GMODE_PATH_OBJECT.
After - HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_EndText()

    HPDF_STATUS HPDF_Page_EndText (HPDF_Page page);

Description

HPDF_Page_EndText() ends a text object.

Parameters

page - The handle of a page object.

Graphic Mode

Before: HPDF_GMODE_TEXT_OBJECT.
After: HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

See Also

HPDF_Page_BeginText()

## HPDF_Page_Eoclip()

Please edit this section if you have used and understand this function.

## HPDF_Page_Eofill()

    HPDF_STATUS HPDF_Page_Eofill (HPDF_Page page);

Description

HPDF_Page_Eofill() fills the current path using the even-odd rule.

Parameters

page - The handle of a page object.

Graphics Mode

Before - HPDF_GMODE_PATH_OBJECT.
After - HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_EofillStroke()

    HPDF_STATUS HPDF_Page_EofillStroke (HPDF_Page page);

Description

HPDF_Page_EofillStroke() fills the current path using the even-odd rule, then paints the path.

Parameters

page - The handle of a page object.

Graphics Mode

Before - HPDF_GMODE_PATH_OBJECT.
After - HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_ExecuteXObject()

Please edit this section if you have used and understand this function.

## HPDF_Page_Fill()

    HPDF_STATUS HPDF_Page_Fill (HPDF_Page page);

Description

HPDF_Page_Fill() fills the current path using the nonzero winding number rule.

Parameters

page - The handle of a page object.

Graphics Mode

Before - HPDF_GMODE_PATH_OBJECT.
After - HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_FillStroke()

    HPDF_STATUS HPDF_Page_FillStroke (HPDF_Page page);

Description

HPDF_Page_FillStroke() fills the current path using the nonzero winding number rule, then paints the path.

Parameters

page - The handle of a page object.

Graphics Mode

Before - HPDF_GMODE_PATH_OBJECT.
After - HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_GRestore()

    HPDF_STATUS HPDF_Page_GRestore (HPDF_Page page);

Description

HPDF_Page_GRestore() restore the graphics state which is saved by HPDF_Page_GSave().

Parameters

page - The handle of a page object.

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_GSave()

    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() are:

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

Parameters

page - The handle of a page object.

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_LineTo()

    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.

Parameters

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

Graphics Mode

Before and after - HPDF_GMODE_PATH_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_MoveTextPos()

    HPDF_STATUS HPDF_Page_MoveTextPos (HPDF_Page  page,
                                       HPDF_REAL  x,
                                       HPDF_REAL  y);

Description

HPDF_Page_MoveTextPos() changes the current text position, using the specified offset values. If the current text position is (x1, y1), the new text position will be (x1 + x, y1 + y).

Parameters

page - The handle of a page object.
x, y - The offset to new text position.

Graphics Mode

Before and after - HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_MoveTextPos2()

    HPDF_STATUS HPDF_Page_MoveTextPos2  (HPDF_Page  page,
                                         HPDF_REAL  x,
                                         HPDF_REAL  y);

Description

HPDF_Page_MoveTextPos2() changes the current text position, using the specified offset values. If the current text position is (x1, y1), the new text position will be (x1 + x, y1 + y).

Also, the text-leading is set to -y.

Parameters

page - The handle of a page object.
x, y - The offset to new text position.

Graphics Mode

Before and after - HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_MoveTo()

    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).

Parameters

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

Graphics Mode

Before - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_PATH_OBJECT.
After - HPDF_GMODE_PATH_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_MoveToNextLine()

    HPDF_STATUS HPDF_Page_MoveToNextLine (HPDF_Page page);

Description

HPDF_Page_MoveToNextLine(). XXX

Parameters

page - The handle of a page object.

Return Value

XXX

## HPDF_Page_Rectangle()

    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.

Parameters

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.

Graphics Mode

Before - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_PATH_OBJECT.
After - HPDF_GMODE_PATH_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetCharSpace()

    HPDF_STATUS HPDF_Page_SetCharSpace (HPDF_Page page,
                                        HPDF_REAL value);

Description

HPDF_Page_SetCharSpace() sets the character spacing for text.

Parameters

page - The handle of a page object.
value - The character spacing (initial value is 0).

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetCMYKFill()

    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.

Parameters

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

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetCMYKStroke()

    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.

Parameters

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

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetDash()

    HPDF_STATUS HPDF_Page_SetDash  (HPDF_Page           page,
                                    const HPDF_UINT16  *dash_ptn,
                                    HPDF_UINT           num_elem,
                                    HPDF_UINT           phase);

Description

HPDF_Page_SetDash() sets the dash pattern for lines in the page.

Examples

- dash_ptn = NULL, num_elem = 0, phase = 0 (default for new page)

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

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

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

Parameters

page - The handle of a page object.
dash_pattern - Pattern of dashes and gaps used to stroke paths.
num_elem - Number of elements in dash_pattern. 0 <= num_param <= 8.
phase - The phase in which the pattern begins (default is 0).

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetExtGState()

    HPDF_STATUS HPDF_Page_SetExtGState (HPDF_Page page,
                                        HPDF_ExtGState ext_gstate);

Description

HPDF_Page_SetExtGState() applyies the graphics state to the page.

Parameters

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

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetFontAndSize()

    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.

Parameters

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

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetGrayFill()

    HPDF_STATUS HPDF_Page_SetGrayFill (HPDF_Page page, HPDF_REAL gray);

Description

HPDF_Page_SetGrayFill() sets the filling color.

Parameters

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

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetGrayStroke()

    HPDF_STATUS HPDF_Page_SetGrayStroke (HPDF_Page page, HPDF_REAL gray);

Description

HPDF_Page_SetGrayStroke() sets the stroking color.

Parameters

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

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetHorizontalScalling()

    HPDF_STATUS HPDF_Page_SetHorizontalScalling (HPDF_Page page,
                                                 HPDF_REAL value);

Description

HPDF_Page_SetHorizontalScalling() sets the horizontal scalling (scaling) for text showing.

Parameters

page - The handle of a page object.
value - The value of horizontal scalling (scaling) (initially 100).

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetLineCap()

    HPDF_STATUS HPDF_Page_SetLineCap (HPDF_Page     page,
                                      HPDF_LineCap  line_cap);

Description

HPDF_Page_SetLineCap() sets the shape to be used at the ends of lines.

Parameters

page - The handle of a page object.
line_cap - The line cap style (one of the following).

Value |  | Description
--- | --- | ---
HPDF_BUTT_END |  | Line is squared off at path endpoint.
HPDF_ROUND_END |  | End of line becomes a semicircle whose center is at path endpoint.
HPDF_PROJECTING_SCUARE_END |  | Line continues beyond endpoint, goes on half the endpoint stroke width.

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetLineJoin()

    HPDF_STATUS HPDF_Page_SetLineJoin (HPDF_Page      page,
                                       HPDF_LineJoin  line_join);

Description

HPDF_Page_SetLineJoin() Sets the line join style in the page.

Parameters

page - The handle of a page object.
line_join - The line join style (one of the following).

value | sample
--- | ---
HPDF_MITER_JOIN (default) |
HPDF_ROUND_JOIN |
HPDF_BEVEL_JOIN |

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetLineWidth()

    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.

Parameters

page - The handle of a page object.
line_width - The line width to use (default is 1).

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetMiterLimit()

    HPDF_STATUS HPDF_Page_SetMiterLimit (HPDF_Page  page,
                                         HPDF_REAL  miter_limit);

Description

XXX

Parameters

page - The handle of a page object.
miter_limit -

Graphics Mode

XXX

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetRGBFill()

    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.

Parameters

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")

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetRGBStroke()

    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.

Parameters

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")

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetTextLeading()

    HPDF_STATUS HPDF_Page_SetTextLeading (HPDF_Page page,
                                          HPDF_REAL value);

Description

HPDF_Page_SetTextLeading() sets the text leading (line spacing) for text showing.

Parameters

page - The handle of a page object.
value - The value of text leading (initial value is 0).

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetTextMatrix()

?????

Graphics Mode

Before and after - HPDF_GMODE_TEXT_OBJECT.

## HPDF_Page_SetTextRenderingMode()

    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.

Parameters

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 |

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetTextRise()

    HPDF_STATUS HPDF_Page_SetTextRise (HPDF_Page page,
                                       HPDF_REAL value);

Description

HPDF_Page_SetTextRise() moves the text position in vertical direction by the amount of value. Useful for making subscripts or superscripts.

Parameters

page - The handle of a page object.
value - Text rise, in user space units.

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_SetWordSpace()

    HPDF_STATUS HPDF_Page_SetWordSpace (HPDF_Page page,
                                        HPDF_REAL value);

Description

HPDF_Page_SetWordSpace() sets the word spacing for text.

Parameters

page - The handle of a page object.
value - The value of word spacing (initial value is 0).

Graphics Mode

Before and after - HPDF_GMODE_PAGE_DESCRIPTION or HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_ShowText()

    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.

Parameters

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

Graphics Mode

Before and after - HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

See Also

HPDF_Page_BeginText()
HPDF_Page_EndText()

## HPDF_Page_ShowTextNextLine()

    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.

Parameters

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

Graphics Mode

Before and after - HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

See Also

HPDF_Page_BeginText()
HPDF_Page_EndText()

## HPDF_Page_ShowTextNextLineEx()

    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 word spacing and character spacing; finally prints the text at the current position on the page.

Parameters

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

Graphics Mode

Before and after - HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

See Also

HPDF_Page_BeginText()
HPDF_Page_EndText()

## HPDF_Page_Stroke()

    HPDF_STATUS HPDF_Page_Stroke (HPDF_Page page);

Description

HPDF_Page_Stroke() paints the current path.

Parameters

page - The handle of a page object.

Graphics Mode

Before - HPDF_GMODE_PATH_OBJECT.
After - HPDF_GMODE_PAGE_DESCRIPTION.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

## HPDF_Page_TextOut()

    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.

Parameters

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

Graphics Mode

Before and after - HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

See Also

HPDF_Page_BeginText()
HPDF_Page_EndText()

## HPDF_Page_TextRect()

    HPDF_STATUS 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() prints the text inside the specified region.

Parameters

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 (one of the following).

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 not NULL, the number of characters printed in the area is returned.

Graphics Mode

Before and after - HPDF_GMODE_TEXT_OBJECT.

Return Value

Returns HPDF_OK on success. Otherwise, returns error code and error-handler is invoked.

Retrieved from "http://daylessday../../../../articles/d/o/c/Documentation_API_Graphics_1583.html"

##### Views

- Page
- Discussion
- View source
- History

##### Personal tools

- Log in

##### Search

##### Toolbox

- What links here
- Related changes
- Special pages
- Printable version
- Permanent link