Haru Free PDF Library
Graphics

Functions

HPDF_STATUS HPDF_Page_SetLineWidth (HPDF_Page page, HPDF_REAL line_width)
 Set width of the line used to stroke paths. More...
 
HPDF_STATUS HPDF_Page_SetLineCap (HPDF_Page page, HPDF_LineCap line_cap)
 Set lines endpoints shape style. More...
 
HPDF_STATUS HPDF_Page_SetLineJoin (HPDF_Page page, HPDF_LineJoin line_join)
 Set line join shape style. More...
 
HPDF_STATUS HPDF_Page_SetMiterLimit (HPDF_Page page, HPDF_REAL miter_limit)
 Set miter limit for line joins. More...
 
HPDF_STATUS HPDF_Page_SetDash (HPDF_Page page, const HPDF_REAL *dash_pattern, HPDF_UINT num_elem, HPDF_REAL phase)
 Set dash pattern for lines in the page. More...
 
HPDF_STATUS HPDF_Page_SetExtGState (HPDF_Page page, HPDF_ExtGState ext_gstate)
 Apply graphics state to page. More...
 
HPDF_STATUS HPDF_Page_GSave (HPDF_Page page)
 Save the page's current graphics state to the stack. More...
 
HPDF_STATUS HPDF_Page_GRestore (HPDF_Page page)
 Restore graphics state which is saved by HPDF_Page_GSave(). More...
 
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)
 Concatenate the page's transformation matrix and specified matrix. More...
 
HPDF_STATUS HPDF_Page_Translate (HPDF_Page page, HPDF_REAL dx, HPDF_REAL dy)
 Concatenate the page's transformation matrix with translation matrix. More...
 
HPDF_STATUS HPDF_Page_Scale (HPDF_Page page, HPDF_REAL sx, HPDF_REAL sy)
 Concatenate the page's transformation matrix with scale matrix. More...
 
HPDF_STATUS HPDF_Page_RotateDeg (HPDF_Page page, HPDF_REAL degrees)
 Concatenate the page's transformation matrix with rotate matrix. More...
 
HPDF_STATUS HPDF_Page_Rotate (HPDF_Page page, HPDF_REAL a)
 Concatenate the page's transformation matrix with rotate matrix. More...
 
HPDF_STATUS HPDF_Page_Skew (HPDF_Page page, HPDF_REAL a, HPDF_REAL b)
 Concatenate the page's transformation matrix with skew matrix. More...
 
HPDF_STATUS HPDF_Page_MoveTo (HPDF_Page page, HPDF_REAL x, HPDF_REAL y)
 Start new subpath and move current point for drawing path. More...
 
HPDF_STATUS HPDF_Page_LineTo (HPDF_Page page, HPDF_REAL x, HPDF_REAL y)
 Append path from current point to specified point. More...
 
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)
 Append Bézier curve to current path using control points (x1, y1) and (x2, y2) and (x3, y3), then set current point to (x3, y3). More...
 
HPDF_STATUS HPDF_Page_CurveTo2 (HPDF_Page page, HPDF_REAL x2, HPDF_REAL y2, HPDF_REAL x3, HPDF_REAL y3)
 Append Bézier curve to current path using current point and (x2, y2) and (x3, y3) as control points. Then current point is set to (x3, y3). More...
 
HPDF_STATUS HPDF_Page_CurveTo3 (HPDF_Page page, HPDF_REAL x1, HPDF_REAL y1, HPDF_REAL x3, HPDF_REAL y3)
 Append 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). More...
 
HPDF_STATUS HPDF_Page_ClosePath (HPDF_Page page)
 Append straight line from current point to the start point of subpath. More...
 
HPDF_STATUS HPDF_Page_Rectangle (HPDF_Page page, HPDF_REAL x, HPDF_REAL y, HPDF_REAL width, HPDF_REAL height)
 Append rectangle to the current path. More...
 
HPDF_STATUS HPDF_Page_Stroke (HPDF_Page page)
 Paint current path. More...
 
HPDF_STATUS HPDF_Page_ClosePathStroke (HPDF_Page page)
 Close and paint current path. More...
 
HPDF_STATUS HPDF_Page_Fill (HPDF_Page page)
 Fill current path using non-zero winding number rule. More...
 
HPDF_STATUS HPDF_Page_Eofill (HPDF_Page page)
 Fill current path using even-odd rule. More...
 
HPDF_STATUS HPDF_Page_FillStroke (HPDF_Page page)
 Fill current path using the even-odd rule. More...
 
HPDF_STATUS HPDF_Page_EofillStroke (HPDF_Page page)
 Fill current path using the even-odd rule and then paint the path. More...
 
HPDF_STATUS HPDF_Page_ClosePathFillStroke (HPDF_Page page)
 Close current path, fill current path using the non-zero winding number rule, then paint path. More...
 
HPDF_STATUS HPDF_Page_ClosePathEofillStroke (HPDF_Page page)
 Close current path, fill current path using the even-odd rule and then paint the path. More...
 
HPDF_STATUS HPDF_Page_EndPath (HPDF_Page page)
 Finish path object without filling or painting. More...
 
HPDF_STATUS HPDF_Page_Clip (HPDF_Page page)
 Modify current clipping path by intersecting it with current path using the nonzero winding number rule. More...
 
HPDF_STATUS HPDF_Page_Eoclip (HPDF_Page page)
 Modifies the current clipping path by intersecting it with current path using the even-odd rule. Clipping path is only modified after succeeding painting operator. To avoid painting current path, use HPDF_Page_EndPath(). More...
 
HPDF_STATUS HPDF_Page_BeginText (HPDF_Page page)
 Begin text object and set text position to (0, 0). More...
 
HPDF_STATUS HPDF_Page_EndText (HPDF_Page page)
 Finish text object. More...
 
HPDF_STATUS HPDF_Page_SetCharSpace (HPDF_Page page, HPDF_REAL value)
 Set text character spacing. More...
 
HPDF_STATUS HPDF_Page_SetWordSpace (HPDF_Page page, HPDF_REAL value)
 Set text word spacing. More...
 
HPDF_STATUS HPDF_Page_SetHorizontalScalling (HPDF_Page page, HPDF_REAL value)
 Set text horizontal scaling. More...
 
HPDF_STATUS HPDF_Page_SetTextLeading (HPDF_Page page, HPDF_REAL value)
 Set text leading (line spacing). More...
 
HPDF_STATUS HPDF_Page_SetFontAndSize (HPDF_Page page, HPDF_Font font, HPDF_REAL size)
 Set the type of font and size leading. More...
 
HPDF_STATUS HPDF_Page_SetTextRenderingMode (HPDF_Page page, HPDF_TextRenderingMode mode)
 Set text rendering mode. More...
 
HPDF_STATUS HPDF_Page_SetTextRise (HPDF_Page page, HPDF_REAL value)
 Move text position in vertical direction by the amount of value. More...
 
HPDF_STATUS HPDF_Page_SetTextRaise (HPDF_Page page, HPDF_REAL value)
 Move text position in vertical direction by the amount of value. More...
 
HPDF_STATUS HPDF_Page_MoveTextPos (HPDF_Page page, HPDF_REAL x, HPDF_REAL y)
 Change current text position using the specified offset values. More...
 
HPDF_STATUS HPDF_Page_MoveTextPos2 (HPDF_Page page, HPDF_REAL x, HPDF_REAL y)
 Change current text position using the specified offset values. More...
 
HPDF_STATUS HPDF_Page_MoveToNextLine (HPDF_Page page)
 Move current position for text showing depending on current text showing point and text leading. More...
 
HPDF_STATUS HPDF_Page_ShowText (HPDF_Page page, const char *text)
 Put text at the current text position on the page. More...
 
HPDF_STATUS HPDF_Page_ShowTextNextLine (HPDF_Page page, const char *text)
 Move current text position to the start of the next line, then put the text at the current text position on the page. More...
 
HPDF_STATUS HPDF_Page_ShowTextNextLineEx (HPDF_Page page, HPDF_REAL word_space, HPDF_REAL char_space, const char *text)
 Move current text position to the start of the next line, then set word spacing and character spacing, finally put the text at the current text position on the page. More...
 
HPDF_STATUS HPDF_Page_SetGrayFill (HPDF_Page page, HPDF_REAL value)
 Set the filling color (Gray). More...
 
HPDF_STATUS HPDF_Page_SetGrayStroke (HPDF_Page page, HPDF_REAL value)
 Set stroking color (Gray). More...
 
HPDF_STATUS HPDF_Page_SetRGBFill (HPDF_Page page, HPDF_REAL r, HPDF_REAL g, HPDF_REAL b)
 Set filling color (RGB). More...
 
HPDF_STATUS HPDF_Page_SetRGBStroke (HPDF_Page page, HPDF_REAL r, HPDF_REAL g, HPDF_REAL b)
 Set stroke color (RGB). More...
 
HPDF_STATUS HPDF_Page_SetRGBStrokeHex (HPDF_Page page, HPDF_UINT8 r, HPDF_UINT8 g, HPDF_UINT8 b)
 Set stroke color (RGB) using HPDF_UINT8 values. More...
 
HPDF_STATUS HPDF_Page_SetCMYKFill (HPDF_Page page, HPDF_REAL c, HPDF_REAL m, HPDF_REAL y, HPDF_REAL k)
 Set filling color (CMYK). More...
 
HPDF_STATUS HPDF_Page_SetCMYKStroke (HPDF_Page page, HPDF_REAL c, HPDF_REAL m, HPDF_REAL y, HPDF_REAL k)
 Set stroke color (CMYK). More...
 
HPDF_STATUS HPDF_Page_ExecuteXObject (HPDF_Page page, HPDF_XObject obj)
 Draw XObject using current graphics context. More...
 
HPDF_STATUS HPDF_Page_DrawImage (HPDF_Page page, HPDF_Image image, HPDF_REAL x, HPDF_REAL y, HPDF_REAL width, HPDF_REAL height)
 Show an image in one operation. More...
 
HPDF_STATUS HPDF_Page_Circle (HPDF_Page page, HPDF_REAL x, HPDF_REAL y, HPDF_REAL radius)
 Append circle to current path. More...
 
HPDF_STATUS HPDF_Page_Ellipse (HPDF_Page page, HPDF_REAL x, HPDF_REAL y, HPDF_REAL x_radius, HPDF_REAL y_radius)
 Append ellipse to current path. More...
 
HPDF_STATUS HPDF_Page_Arc (HPDF_Page page, HPDF_REAL x, HPDF_REAL y, HPDF_REAL radius, HPDF_REAL ang1, HPDF_REAL ang2)
 Append circle arc to current path. More...
 
HPDF_STATUS HPDF_Page_TextOut (HPDF_Page page, HPDF_REAL xpos, HPDF_REAL ypos, const char *text)
 Put text to the specified position. More...
 
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)
 Put text inside the specified region. More...
 

Detailed Description

Routines for feeding pages with graphical primitives.

Function Documentation

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

Append circle arc to current path.

Angles are given in degrees, with 0 degrees being vertical, upward, from the (x, y) position.

Parameters
pagePage object handle.
x,yCenter point of the circle.
radiusRadius of the circle.
ang1Angle at the begining of the arc.
ang2Angle at the end of the arc. It must be greater than ang1.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Examples
arc_demo.c.

◆ HPDF_Page_BeginText()

HPDF_STATUS HPDF_Page_BeginText ( HPDF_Page  page)

Begin text object and set text position to (0, 0).

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_EndText()
PDF command
BT
Examples
attach.c, character_map.c, chfont_demo.c, encoding_list.c, encryption.c, ext_gstate_demo.c, font_demo.c, grid_sheet.c, image_demo.c, jpeg_demo.c, jpfont_demo.c, line_demo.c, link_annotation.c, outline_demo.c, outline_demo_jp.c, permission.c, png_demo.c, raw_image_demo.c, slide_show_demo.c, text_annotation.c, text_demo.c, text_demo2.c, transforms.c, ttfont_demo.c, ttfont_demo_jp.c, and utf8.c.

◆ HPDF_Page_Circle()

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

Append circle to current path.

Parameters
pagePage object handle.
x,yCenter point of the circle.
radiusCircle radius
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Examples
arc_demo.c, ext_gstate_demo.c, and text_demo2.c.

◆ HPDF_Page_Clip()

HPDF_STATUS HPDF_Page_Clip ( HPDF_Page  page)

Modify current clipping path by intersecting it with current path using the nonzero winding number rule.

The clipping path is only modified after the succeeding painting operator. To avoid painting the current path, use the function HPDF_Page_EndPath().

Following painting operations will only affect the regions of the page contained by the clipping path. Initially, the clipping path includes the entire page. There is no way to enlarge the current clipping path or to replace the clipping path with a new one. The functions HPDF_Page_GSave() and HPDF_Page_GRestore() may be used to save and restore the current graphics state, including the clipping path.

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_EndPath(), HPDF_Page_GSave(), HPDF_Page_GRestore(), HPDF_Page_Eoclip()
PDF command
W
Examples
clip_hatch.c, and line_demo.c.

◆ HPDF_Page_ClosePath()

HPDF_STATUS HPDF_Page_ClosePath ( HPDF_Page  page)

Append straight line from current point to the start point of subpath.

Current point is moved to the start point of subpath.

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
h

◆ HPDF_Page_ClosePathEofillStroke()

HPDF_STATUS HPDF_Page_ClosePathEofillStroke ( HPDF_Page  page)

Close current path, fill current path using the even-odd rule and then paint the path.

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
b*

◆ HPDF_Page_ClosePathFillStroke()

HPDF_STATUS HPDF_Page_ClosePathFillStroke ( HPDF_Page  page)

Close current path, fill current path using the non-zero winding number rule, then paint path.

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
b
Examples
ext_gstate_demo.c.

◆ HPDF_Page_ClosePathStroke()

HPDF_STATUS HPDF_Page_ClosePathStroke ( HPDF_Page  page)

Close and paint current path.

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
s

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

Concatenate the page's 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);
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)
Concatenate the page's transformation matrix and specified matrix.

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 current graphics state
//Concatenate transformation matrix
HPDF_Page_Concat (page, 72.0f / 300.0f, 0, 0, 72.0f / 300.0f, 0, 0);
// Show text on translated coordinates
HPDF_Page_MoveTextPos (page, 50, 100);
HPDF_Page_ShowText (page, "Text on the translated coordinates");
// Restore the graphics states
HPDF_STATUS HPDF_Page_GSave(HPDF_Page page)
Save the page's current graphics state to the stack.
HPDF_STATUS HPDF_Page_ShowText(HPDF_Page page, const char *text)
Put text at the current text position on the page.
HPDF_STATUS HPDF_Page_GRestore(HPDF_Page page)
Restore graphics state which is saved by HPDF_Page_GSave().
HPDF_STATUS HPDF_Page_BeginText(HPDF_Page page)
Begin text object and set text position to (0, 0).
HPDF_STATUS HPDF_Page_EndText(HPDF_Page page)
Finish text object.
HPDF_STATUS HPDF_Page_MoveTextPos(HPDF_Page page, HPDF_REAL x, HPDF_REAL y)
Change current text position using the specified offset values.

Application can call HPDF_Page_GSave() when graphics mode is HPDF_GMODE_PAGE_DESCRIPTION.

Parameters
pagePage object handle.
a,b,c,d,x,yTransformation matrix to concatenate.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
cm
See also
HPDF_Page_Translate(), HPDF_Page_Scale(), HPDF_Page_Rotate(), HPDF_Page_Skew()
Examples
clip_hatch.c, clip_hatch2.c, image_demo.c, matrix.c, and text_demo2.c.

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

Append Bézier curve to current path using control points (x1, y1) and (x2, y2) and (x3, y3), then set current point to (x3, y3).

Parameters
pagePage object handle.
x1,y1,x2,y2,x3,y3Control points for Bézier curve.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
c
Examples
line_demo.c.

◆ HPDF_Page_CurveTo2()

HPDF_STATUS HPDF_Page_CurveTo2 ( HPDF_Page  page,
HPDF_REAL  x2,
HPDF_REAL  y2,
HPDF_REAL  x3,
HPDF_REAL  y3 
)

Append Bézier curve to current path using current point and (x2, y2) and (x3, y3) as control points. Then current point is set to (x3, y3).

Parameters
pagePage object handle.
x2,y2,x3,y3Control points for Bézier curve along with current point.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
v
Examples
line_demo.c.

◆ HPDF_Page_CurveTo3()

HPDF_STATUS HPDF_Page_CurveTo3 ( HPDF_Page  page,
HPDF_REAL  x1,
HPDF_REAL  y1,
HPDF_REAL  x3,
HPDF_REAL  y3 
)

Append 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
pagePage object handle.
x1,y1,x3,y3Control points for Bézier curve along with current point.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
y
Examples
line_demo.c.

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

Show an image in one operation.

Parameters
pagePage object handle.
imageImage object handle
x,yLower-left point of the region where image is displayed.
widthWidth of the region where image is displayed.
heightHeight of the region where image is displayed.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Examples
image_demo.c, jpeg_demo.c, png_demo.c, and raw_image_demo.c.

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

Append ellipse to current path.

Parameters
pagePage object handle.
x,yCenter point of the ellipse.
x_radius,y_radiusHorizontal and vertical radii of the ellipse.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.

◆ HPDF_Page_EndPath()

HPDF_STATUS HPDF_Page_EndPath ( HPDF_Page  page)

Finish path object without filling or painting.

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
n
Examples
clip_hatch.c, and clip_hatch2.c.

◆ HPDF_Page_EndText()

◆ HPDF_Page_Eoclip()

HPDF_STATUS HPDF_Page_Eoclip ( HPDF_Page  page)

Modifies the current clipping path by intersecting it with current path using the even-odd rule. Clipping path is only modified after succeeding painting operator. To avoid painting current path, use HPDF_Page_EndPath().

Following painting operations will only affect page regions contained by the clipping path. Clipping path includes entire page initially. There is no way to enlarge current clipping path or to replace clipping path with new one. Functions HPDF_Page_GSave() and HPDF_Page_GRestore() may be used to save and restore the current graphics state, including the clipping path.

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_EndPath(), HPDF_Page_GSave(), HPDF_Page_GRestore(), HPDF_Page_Clip()
PDF command
W*
Examples
clip_hatch2.c.

◆ HPDF_Page_Eofill()

HPDF_STATUS HPDF_Page_Eofill ( HPDF_Page  page)

Fill current path using even-odd rule.

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
f*

◆ HPDF_Page_EofillStroke()

HPDF_STATUS HPDF_Page_EofillStroke ( HPDF_Page  page)

Fill current path using the even-odd rule and then paint the path.

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
B*

◆ HPDF_Page_ExecuteXObject()

HPDF_STATUS HPDF_Page_ExecuteXObject ( HPDF_Page  page,
HPDF_XObject  obj 
)

Draw XObject using current graphics context.

This is used by HPDF_Page_DrawImage() to draw the HPDF_Image by first calling HPDF_Page_GSave() and HPDF_Page_Concat() and then calling HPDF_Page_GRestore() after HPDF_Page_ExecuteXObject(). It could be used manually to rotate an image.

Parameters
pagePage object handle.
objXObject handle like an image.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
Do
Examples
image_demo.c.

◆ HPDF_Page_Fill()

HPDF_STATUS HPDF_Page_Fill ( HPDF_Page  page)

Fill current path using non-zero winding number rule.

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
f
Examples
arc_demo.c, line_demo.c, pattern.c, pattern2.c, and slide_show_demo.c.

◆ HPDF_Page_FillStroke()

HPDF_STATUS HPDF_Page_FillStroke ( HPDF_Page  page)

Fill current path using the even-odd rule.

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
B
Examples
line_demo.c.

◆ HPDF_Page_GRestore()

HPDF_STATUS HPDF_Page_GRestore ( HPDF_Page  page)

Restore graphics state which is saved by HPDF_Page_GSave().

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
Q
Examples
clip_hatch.c, clip_hatch2.c, ext_gstate_demo.c, image_demo.c, line_demo.c, matrix.c, pattern2.c, text_demo.c, text_demo2.c, transforms.c, and utf8.c.

◆ HPDF_Page_GSave()

HPDF_STATUS HPDF_Page_GSave ( HPDF_Page  page)

Save the page's current graphics state to the stack.

Application can call HPDF_Page_GSave() and can restore saved state by calling HPDF_Page_GRestore().

Saved by HPDF_Page_GSave() state parameters are:

  • Character Spacing
  • Clipping Path
  • 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
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
q
Examples
clip_hatch.c, clip_hatch2.c, ext_gstate_demo.c, image_demo.c, line_demo.c, matrix.c, pattern2.c, text_demo.c, text_demo2.c, transforms.c, and utf8.c.

◆ HPDF_Page_LineTo()

HPDF_STATUS HPDF_Page_LineTo ( HPDF_Page  page,
HPDF_REAL  x,
HPDF_REAL  y 
)

Append path from current point to specified point.

Parameters
pagePage object handle.
x,yEnd point of the path
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
l
Examples
arc_demo.c, character_map.c, clip_hatch.c, clip_hatch2.c, encoding_list.c, grid_sheet.c, image_demo.c, jpfont_demo.c, line_demo.c, matrix.c, text_demo.c, ttfont_demo.c, and ttfont_demo_jp.c.

◆ HPDF_Page_MoveTextPos()

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

Change 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
pagePage object handle.
x,yOffset to new text position.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
Td
Examples
attach.c, character_map.c, chfont_demo.c, encoding_list.c, encryption.c, font_demo.c, grid_sheet.c, image_demo.c, jpeg_demo.c, jpfont_demo.c, line_demo.c, link_annotation.c, outline_demo.c, outline_demo_jp.c, permission.c, png_demo.c, raw_image_demo.c, text_annotation.c, text_demo.c, ttfont_demo.c, ttfont_demo_jp.c, and utf8.c.

◆ HPDF_Page_MoveTextPos2()

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

Change 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, text leading is set to -y.

Parameters
pagePage object handle.
x,yOffset to new text position.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
TD

◆ HPDF_Page_MoveTo()

HPDF_STATUS HPDF_Page_MoveTo ( HPDF_Page  page,
HPDF_REAL  x,
HPDF_REAL  y 
)

Start new subpath and move current point for drawing path.

HPDF_Page_MoveTo() set starting point for the path to (x, y).

Parameters
pagePage object handle.
x,yStarting point for drawing path
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
m
Examples
arc_demo.c, character_map.c, clip_hatch.c, clip_hatch2.c, encoding_list.c, grid_sheet.c, image_demo.c, jpfont_demo.c, line_demo.c, matrix.c, text_demo.c, ttfont_demo.c, and ttfont_demo_jp.c.

◆ HPDF_Page_MoveToNextLine()

HPDF_STATUS HPDF_Page_MoveToNextLine ( HPDF_Page  page)

Move current position for text showing depending on current text showing point and text leading.

New position is calculated with current text transition matrix.

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
T*
Examples
chfont_demo.c, and link_annotation.c.

◆ HPDF_Page_Rectangle()

HPDF_STATUS HPDF_Page_Rectangle ( HPDF_Page  page,
HPDF_REAL  x,
HPDF_REAL  y,
HPDF_REAL  width,
HPDF_REAL  height 
)

Append rectangle to the current path.

Parameters
pagePage object handle.
x,yLower-left point of the rectangle.
widthWidth of the rectangle.
heightHeight of the rectangle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
re
Examples
clip_hatch.c, clip_hatch2.c, font_demo.c, line_demo.c, matrix.c, pattern.c, pattern2.c, slide_show_demo.c, text_demo2.c, and transforms.c.

◆ HPDF_Page_Rotate()

HPDF_STATUS HPDF_Page_Rotate ( HPDF_Page  page,
HPDF_REAL  a 
)

Concatenate the page's transformation matrix with rotate matrix.

Coordinate system axes are rotated by angle a counter clocwise.

Parameters
pagePage object handle.
aCoordinate system rotate angle (radians).
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
cm
See also
HPDF_Page_Concat(), HPDF_Page_RotateDeg()
Note
Corresponds to HPDF_Page_Concat (page, cos(q), sin(q), -sin(q), cos(q), 0, 0);
Examples
matrix.c, and transforms.c.

◆ HPDF_Page_RotateDeg()

HPDF_STATUS HPDF_Page_RotateDeg ( HPDF_Page  page,
HPDF_REAL  degrees 
)

Concatenate the page's transformation matrix with rotate matrix.

Coordinate system axes are rotated by angle a counter clocwise (degrees).

Parameters
pagePage object handle.
degreesCoordinate system rotate angle (degrees).
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
cm
See also
HPDF_Page_Concat(), HPDF_Page_Rotate()

◆ HPDF_Page_Scale()

HPDF_STATUS HPDF_Page_Scale ( HPDF_Page  page,
HPDF_REAL  sx,
HPDF_REAL  sy 
)

Concatenate the page's transformation matrix with scale matrix.

Coordinate system is scaled so 1 unit horizontal dimension is same as sx units and 1 unit in vertical dimension is same as sy units in new coordinate system..

Parameters
pagePage object handle.
sx,syCoordinate system scale values.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
cm
See also
HPDF_Page_Concat()
Note
Corresponds to HPDF_Page_Concat (page, sx, 0, 0, sy, 0, 0);
Examples
matrix.c, and transforms.c.

◆ HPDF_Page_SetCharSpace()

HPDF_STATUS HPDF_Page_SetCharSpace ( HPDF_Page  page,
HPDF_REAL  value 
)

Set text character spacing.

Parameters
pagePage object handle.
valueCharacter spacing (initial value is 0).
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
Tc
Examples
text_demo.c.

◆ HPDF_Page_SetCMYKFill()

HPDF_STATUS HPDF_Page_SetCMYKFill ( HPDF_Page  page,
HPDF_REAL  c,
HPDF_REAL  m,
HPDF_REAL  y,
HPDF_REAL  k 
)

Set filling color (CMYK).

Parameters
pagePage object handle.
c,m,y,kLevel of each color element. They must be between 0 and 1.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_GetCMYKFill()
PDF command
k

◆ HPDF_Page_SetCMYKStroke()

HPDF_STATUS HPDF_Page_SetCMYKStroke ( HPDF_Page  page,
HPDF_REAL  c,
HPDF_REAL  m,
HPDF_REAL  y,
HPDF_REAL  k 
)

Set stroke color (CMYK).

Parameters
pagePage object handle.
c,m,y,kLevel of each color element. They must be between 0 and 1.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_GetCMYKStroke()
PDF command
K

◆ HPDF_Page_SetDash()

HPDF_STATUS HPDF_Page_SetDash ( HPDF_Page  page,
const HPDF_REAL dash_pattern,
HPDF_UINT  num_elem,
HPDF_REAL  phase 
)

Set dash pattern for lines in the page.

Parameters
pagePage object handle.
dash_patternPattern of dashes and gaps used to stroke paths.
num_elemNumber of elements in dash_pattern, 0 <= num_param <= 8.
phasePhase in which pattern begins (default is 0).
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Examples

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

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

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

dash_ptn = [8,], num_elem = 4, phase = 0

PDF command
d
Examples
line_demo.c, and transforms.c.

◆ HPDF_Page_SetExtGState()

HPDF_STATUS HPDF_Page_SetExtGState ( HPDF_Page  page,
HPDF_ExtGState  ext_gstate 
)

Apply graphics state to page.

Parameters
pagePage object handle.
ext_gstateExtended graphics state object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
gs
Examples
ext_gstate_demo.c, and utf8.c.

◆ HPDF_Page_SetFontAndSize()

HPDF_STATUS HPDF_Page_SetFontAndSize ( HPDF_Page  page,
HPDF_Font  font,
HPDF_REAL  size 
)

Set the type of font and size leading.

Parameters
pagePage object handle.
fontFont object handle.
sizeFont size.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
Tf
Examples
attach.c, character_map.c, chfont_demo.c, encoding_list.c, encryption.c, ext_gstate_demo.c, font_demo.c, grid_sheet.c, image_demo.c, jpeg_demo.c, jpfont_demo.c, line_demo.c, link_annotation.c, outline_demo.c, outline_demo_jp.c, permission.c, png_demo.c, raw_image_demo.c, slide_show_demo.c, text_annotation.c, text_demo.c, text_demo2.c, transforms.c, ttfont_demo.c, ttfont_demo_jp.c, and utf8.c.

◆ HPDF_Page_SetGrayFill()

HPDF_STATUS HPDF_Page_SetGrayFill ( HPDF_Page  page,
HPDF_REAL  value 
)

Set the filling color (Gray).

Parameters
pagePage object handle.
valueValue of the gray level between 0 and 1.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_GetGrayFill()
PDF command
g
Examples
arc_demo.c, and grid_sheet.c.

◆ HPDF_Page_SetGrayStroke()

HPDF_STATUS HPDF_Page_SetGrayStroke ( HPDF_Page  page,
HPDF_REAL  value 
)

Set stroking color (Gray).

Parameters
pagePage object handle.
valueValue of the gray level between 0 and 1.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_GetGrayStroke()
PDF command
G
Examples
arc_demo.c, grid_sheet.c, and text_demo2.c.

◆ HPDF_Page_SetHorizontalScalling()

HPDF_STATUS HPDF_Page_SetHorizontalScalling ( HPDF_Page  page,
HPDF_REAL  value 
)

Set text horizontal scaling.

Parameters
pagePage object handle.
valueValue of horizontal scaling (initially 100).
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Todo:
Deprecate and rename function
PDF command
Tz

◆ HPDF_Page_SetLineCap()

HPDF_STATUS HPDF_Page_SetLineCap ( HPDF_Page  page,
HPDF_LineCap  line_cap 
)

Set lines endpoints shape style.

Parameters
pagePage object handle.
line_capThe line cap style (one of the following).
Value Image Description
HPDF_BUTT_END
Line is squared off at path endpoint.
HPDF_ROUND_END
End of line becomes a semicircle with center at path endpoint.
HPDF_PROJECTING_SQUARE_END
Line continues beyond endpoint, goes on half the endpoint stroke width.

Default line_cap is HPDF_BUTT_END

Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
J
Examples
line_demo.c.

◆ HPDF_Page_SetLineJoin()

HPDF_STATUS HPDF_Page_SetLineJoin ( HPDF_Page  page,
HPDF_LineJoin  line_join 
)

Set line join shape style.

Parameters
pagePage object handle.
line_joinThe line join style (one of the following).
Value Image Description
HPDF_MITER_JOIN
Outer edges of the strokes for the two segments are extended until they meet at an angle.
HPDF_ROUND_JOIN
An arc of a circle with a diameter equal to the line width is drawn around the point where the two segments meet.
HPDF_BEVEL_JOIN
The two segments are finished with butt caps and the resulting notch beyond the ends of the segments are filled with a triangle.

Default line_join is HPDF_MITER_JOIN.

Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
j
Examples
line_demo.c.

◆ HPDF_Page_SetLineWidth()

HPDF_STATUS HPDF_Page_SetLineWidth ( HPDF_Page  page,
HPDF_REAL  line_width 
)

Set width of the line used to stroke paths.

Parameters
pagePage object handle.
line_widthThe line width to use.

Default line_width is 1.

Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
w
Examples
clip_hatch.c, clip_hatch2.c, encoding_list.c, ext_gstate_demo.c, font_demo.c, grid_sheet.c, image_demo.c, jpfont_demo.c, line_demo.c, text_demo.c, transforms.c, ttfont_demo.c, and ttfont_demo_jp.c.

◆ HPDF_Page_SetMiterLimit()

HPDF_STATUS HPDF_Page_SetMiterLimit ( HPDF_Page  page,
HPDF_REAL  miter_limit 
)

Set miter limit for line joins.

Parameters
pagePage object handle.
miter_limitMiter limit value.

Default miter_limit is HPDF_DEF_MITERLIMIT.

Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Note
A miter limit of 1.414 converts miters to bevels for angle less than 90 degrees, a limit of 2.0 converts them for angle less than 60 degrees, and a limit of 10.0 converts them for angle less than approximately 11.5 degrees.
PDF command
M

◆ HPDF_Page_SetRGBFill()

HPDF_STATUS HPDF_Page_SetRGBFill ( HPDF_Page  page,
HPDF_REAL  r,
HPDF_REAL  g,
HPDF_REAL  b 
)

Set filling color (RGB).

Parameters
pagePage object handle.
r,g,bLevel of each color element. They must be between 0 and 1.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_GetRGBFill()
PDF command
rg
Examples
arc_demo.c, ext_gstate_demo.c, image_demo.c, line_demo.c, slide_show_demo.c, text_demo.c, and utf8.c.

◆ HPDF_Page_SetRGBStroke()

HPDF_STATUS HPDF_Page_SetRGBStroke ( HPDF_Page  page,
HPDF_REAL  r,
HPDF_REAL  g,
HPDF_REAL  b 
)

Set stroke color (RGB).

Parameters
pagePage object handle.
r,g,bLevel of each color element. They must be between 0 and 1.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_GetRGBStroke()
PDF command
RG
Examples
ext_gstate_demo.c, line_demo.c, text_demo.c, and transforms.c.

◆ HPDF_Page_SetRGBStrokeHex()

HPDF_STATUS HPDF_Page_SetRGBStrokeHex ( HPDF_Page  page,
HPDF_UINT8  r,
HPDF_UINT8  g,
HPDF_UINT8  b 
)

Set stroke color (RGB) using HPDF_UINT8 values.

Parameters
pagePage object handle.
r,g,bLevel of each color element. They must be between 0x00 and 0xFF.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_GetRGBStroke(), HPDF_Page_SetRGBStroke()
PDF command
RG
Examples
clip_hatch.c, and clip_hatch2.c.

◆ HPDF_Page_SetTextLeading()

HPDF_STATUS HPDF_Page_SetTextLeading ( HPDF_Page  page,
HPDF_REAL  value 
)

Set text leading (line spacing).

Parameters
pagePage object handle.
valueValue of text leading (initially 0).
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
TL
Examples
chfont_demo.c, jpeg_demo.c, line_demo.c, link_annotation.c, png_demo.c, and text_demo2.c.

◆ HPDF_Page_SetTextRaise()

HPDF_STATUS HPDF_Page_SetTextRaise ( HPDF_Page  page,
HPDF_REAL  value 
)

Move text position in vertical direction by the amount of value.

Deprecated:
Use HPDF_Page_SetTextRise() instead.

Useful for making subscripts or superscripts.

Parameters
pagePage object handle.
valueText rise, in user space units.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Todo:
Add picture for HPDF_CLIPPING
See also
HPDF_Page_SetTextRise()
PDF command
Ts

◆ HPDF_Page_SetTextRenderingMode()

HPDF_STATUS HPDF_Page_SetTextRenderingMode ( HPDF_Page  page,
HPDF_TextRenderingMode  mode 
)

Set text rendering mode.

Parameters
pagePage object handle.
modeText rendering mode (one of the following).
Value Image Description
HPDF_FILL
Fill text.
HPDF_STROKE
Stroke text.
HPDF_FILL_THEN_STROKE
Fill, then stroke text.
HPDF_INVISIBLE Neither fill nor stroke text (invisible).
HPDF_FILL_CLIPPING
Fill text and add to path for clipping.
HPDF_STROKE_CLIPPING
Stroke text and add to path for clipping.
HPDF_FILL_STROKE_CLIPPING
Fill, then stroke text and add to path for clipping.
HPDF_CLIPPING Add text to path for clipping.

Default mode is HPDF_FILL.

Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Todo:
Add picture for HPDF_CLIPPING
PDF command
Tr
Examples
text_demo.c.

◆ HPDF_Page_SetTextRise()

HPDF_STATUS HPDF_Page_SetTextRise ( HPDF_Page  page,
HPDF_REAL  value 
)

Move text position in vertical direction by the amount of value.

Useful for making subscripts or superscripts.

Parameters
pagePage object handle.
valueText rise, in user space units.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Todo:
Add picture for HPDF_CLIPPING
See also
HPDF_Page_SetTextRaise()
PDF command
Ts

◆ HPDF_Page_SetWordSpace()

HPDF_STATUS HPDF_Page_SetWordSpace ( HPDF_Page  page,
HPDF_REAL  value 
)

Set text word spacing.

Parameters
pagePage object handle.
valueWord spacing (initial value is 0).
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
Tw
Examples
text_demo.c.

◆ HPDF_Page_ShowText()

HPDF_STATUS HPDF_Page_ShowText ( HPDF_Page  page,
const char *  text 
)

Put text at the current text position on the page.

Parameters
pagePage object handle.
textText to put to page.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_BeginText(), HPDF_Page_EndText()
PDF command
Tj
Examples
attach.c, character_map.c, chfont_demo.c, encoding_list.c, encryption.c, font_demo.c, grid_sheet.c, image_demo.c, jpeg_demo.c, jpfont_demo.c, line_demo.c, link_annotation.c, outline_demo.c, outline_demo_jp.c, permission.c, png_demo.c, raw_image_demo.c, text_annotation.c, text_demo.c, text_demo2.c, ttfont_demo.c, ttfont_demo_jp.c, and utf8.c.

◆ HPDF_Page_ShowTextNextLine()

HPDF_STATUS HPDF_Page_ShowTextNextLine ( HPDF_Page  page,
const char *  text 
)

Move current text position to the start of the next line, then put the text at the current text position on the page.

Parameters
pagePage object handle.
textText to put to page.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
See also
HPDF_Page_BeginText(), HPDF_Page_EndText()
PDF command
' (apostrophe)
Examples
jpeg_demo.c, line_demo.c, and png_demo.c.

◆ HPDF_Page_ShowTextNextLineEx()

HPDF_STATUS HPDF_Page_ShowTextNextLineEx ( HPDF_Page  page,
HPDF_REAL  word_space,
HPDF_REAL  char_space,
const char *  text 
)

Move current text position to the start of the next line, then set word spacing and character spacing, finally put the text at the current text position on the page.

Parameters
pagePage object handle.
textText to put to page.
word_spaceWord spacing value
char_spaceChar spacing value
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Todo:
Write note: same as aw Tw; ac Tc; string ', Table 109 of PDF book
See also
HPDF_Page_BeginText(), HPDF_Page_EndText()
PDF command
" (quote)

◆ HPDF_Page_Skew()

HPDF_STATUS HPDF_Page_Skew ( HPDF_Page  page,
HPDF_REAL  a,
HPDF_REAL  b 
)

Concatenate the page's transformation matrix with skew matrix.

Coordinate system is skewed by an angle a at x axis and by angle b at y axis.

Parameters
pagePage object handle.
a,bCoordinate system skew values.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
cm
See also
HPDF_Page_Concat()
Note
Corresponds to HPDF_Page_Concat (page, 1, tan(a), tan(b), 1, 0, 0);
Examples
transforms.c.

◆ HPDF_Page_Stroke()

HPDF_STATUS HPDF_Page_Stroke ( HPDF_Page  page)

Paint current path.

Parameters
pagePage object handle.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
S
Examples
character_map.c, clip_hatch.c, clip_hatch2.c, encoding_list.c, font_demo.c, grid_sheet.c, image_demo.c, jpfont_demo.c, line_demo.c, matrix.c, text_demo.c, text_demo2.c, transforms.c, ttfont_demo.c, and ttfont_demo_jp.c.

◆ HPDF_Page_TextOut()

HPDF_STATUS HPDF_Page_TextOut ( HPDF_Page  page,
HPDF_REAL  xpos,
HPDF_REAL  ypos,
const char *  text 
)

Put text to the specified position.

Parameters
pagePage object handle.
xpos,yposPoint position where the text is displayed.
textText to show.
Graphics mode
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
Examples
encoding_list.c, ext_gstate_demo.c, font_demo.c, slide_show_demo.c, text_demo.c, text_demo2.c, and transforms.c.

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

Put text inside the specified region.

Parameters
pagePage object handle.
left,top,right,bottomCoordinates of corners of the region to output text.
textText to show.
align

Text alignment (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.
lenIf not NULL, the number of characters printed in the area is returned.
Graphics mode
Returns
HPDF_OK on success. May return HPDF_PAGE_INSUFFICIENT_SPACE on success but whole text doesn't fit into declared space. Otherwise, returns error code and calls error handler.
Examples
text_demo2.c.

◆ HPDF_Page_Translate()

HPDF_STATUS HPDF_Page_Translate ( HPDF_Page  page,
HPDF_REAL  dx,
HPDF_REAL  dy 
)

Concatenate the page's transformation matrix with translation matrix.

Coordinate system is translated by dx and dy coordinate units.

Parameters
pagePage object handle.
dx,dyCoordinate system translate distance.
Returns
HPDF_OK on success, otherwise returns error code and calls error handler.
PDF command
cm
See also
HPDF_Page_Concat()
Note
Corresponds to HPDF_Page_Concat (page, 1, 0, 0, 1, dx, dy);
Examples
matrix.c, and transforms.c.