You gave bad parameters, missing the handle of a page object.
Code: Select all
//Note: all units are in pixels. The Y axis is reversed relative to HMG HPDF. Point 0 indicates the bottom edge of the page.
Page := _HMG_SYSDATA[ 150 ][ 7 ] //The handle of a page object
/* Curve Example(CurveTo2) */
x = 330
y = 440
x1 = 430
y1 = 530
x2 = 480
y2 = 470
x3 = 480
y3 = 90
HPDF_Page_SetRGBFill (page, 0, 0, 0) //sets the filling color. See colors: http://libharu.sourceforge.net/graphics.html#Colors
HPDF_Page_SetRGBStroke( page, 0, 0, 0) //sets the stroking color
HPDF_Page_BeginText (page) //begins a text object and sets the current text position to the point (0, 0).
HPDF_Page_MoveTextPos (page, 300, 540) //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).
HPDF_Page_ShowText (page, "CurveTo2(x1, y1, x2, y2)") //prints the text at the current position on the page.
HPDF_Page_EndText (page) //ends a text object
HPDF_Page_BeginText (page)
HPDF_Page_MoveTextPos (page, x + 5, y - 5)
HPDF_Page_ShowText (page, "Current point")
HPDF_Page_MoveTextPos (page, x1 - x, y1 - y)
HPDF_Page_ShowText (page, "(x1, y1)")
HPDF_Page_MoveTextPos (page, x2 - x1, y2 - y1)
HPDF_Page_ShowText (page, "(x2, y2)")
HPDF_Page_EndText (page)
HPDF_Page_SetDash (page, {3}, 1, 0) //Sets the line dash pattern in the page to dotted line
HPDF_Page_SetLineWidth (page, 0.5) //sets the width of the line used to stroke a path
HPDF_Page_MoveTo (page, x1, y1) //starts a new subpath and move the current point for drawing path
HPDF_Page_LineTo (page, x2, y2) //appends a path from the current point to the specified point
HPDF_Page_Stroke (page) //paints the current path
HPDF_Page_SetDash (page, NIL, 0, 0) //Sets the line dash pattern in the page to solid line
HPDF_Page_SetLineWidth (page, 1.5) //sets the width of the line used to stroke a path
HPDF_Page_MoveTo (page, x, y) //starts a new subpath and move the current point for drawing path
HPDF_Page_CurveTo2 (page, x1, y1, x2, y2) //appends a Bézier curve to the current path using two spesified points
HPDF_Page_Stroke (page) //paints the current path
/* Curve Example(CurveTo3) */
y -= 150
y1 -= 150
y2 -= 150
HPDF_Page_BeginText (page)
HPDF_Page_MoveTextPos (page, 300, 390)
HPDF_Page_ShowText (page, "CurveTo3(x1, y1, x2, y2)")
HPDF_Page_EndText (page)
HPDF_Page_BeginText (page)
HPDF_Page_MoveTextPos (page, x + 5, y - 5)
HPDF_Page_ShowText (page, "Current point")
HPDF_Page_MoveTextPos (page, x1 - x, y1 - y)
HPDF_Page_ShowText (page, "(x1, y1)")
HPDF_Page_MoveTextPos (page, x2 - x1, y2 - y1)
HPDF_Page_ShowText (page, "(x2, y2)")
HPDF_Page_EndText (page)
HPDF_Page_SetDash (page, {3}, 1, 0) //Sets the line dash pattern in the page to dotted line
HPDF_Page_SetLineWidth (page, 0.5) //sets the width of the line used to stroke a path
HPDF_Page_MoveTo (page, x, y) //starts a new subpath and move the current point for drawing path
HPDF_Page_LineTo (page, x1, y1) //appends a path from the current point to the specified point
HPDF_Page_Stroke (page) //paints the current path
HPDF_Page_SetDash (page, NIL, 0, 0) //Sets the line dash pattern in the page to solid line
HPDF_Page_SetLineWidth (page, 1.5) //sets the width of the line used to stroke a path
HPDF_Page_MoveTo (page, x, y) //starts a new subpath and move the current point for drawing path
HPDF_Page_CurveTo3 (page, x1, y1, x2, y2) //appends a Bézier curve to the current path using two spesified points
HPDF_Page_Stroke (page) //paints the current path
/* Curve Example(CurveTo) */
y -= 150
y1 -= 160
y2 -= 130
x2 += 10
HPDF_Page_BeginText (page)
HPDF_Page_MoveTextPos (page, 300, 240)
HPDF_Page_ShowText (page, "CurveTo(x1, y1, x2, y2, x3, y3)")
HPDF_Page_EndText (page)
HPDF_Page_BeginText (page)
HPDF_Page_MoveTextPos (page, x + 5, y - 5)
HPDF_Page_ShowText (page, "Current point")
HPDF_Page_MoveTextPos (page, x1 - x, y1 - y)
HPDF_Page_ShowText (page, "(x1, y1)")
HPDF_Page_MoveTextPos (page, x2 - x1, y2 - y1)
HPDF_Page_ShowText (page, "(x2, y2)")
HPDF_Page_MoveTextPos (page, x3 - x2, y3 - y2)
HPDF_Page_ShowText (page, "(x3, y3)")
HPDF_Page_EndText (page)
HPDF_Page_SetDash (page, {3}, 1, 0) //Sets the line dash pattern in the page to dotted line
HPDF_Page_SetLineWidth (page, 0.5) //sets the width of the line used to stroke a path
HPDF_Page_MoveTo (page, x, y) //starts a new subpath and move the current point for drawing path
HPDF_Page_LineTo (page, x1, y1) //appends a path from the current point to the specified point
HPDF_Page_Stroke (page) //paints the current path
HPDF_Page_MoveTo (page, x2, y2) //starts a new subpath and move the current point for drawing path
HPDF_Page_LineTo (page, x3, y3) //appends a path from the current point to the specified point
HPDF_Page_Stroke (page) //paints the current path
HPDF_Page_SetDash (page, NIL, 0, 0) //Sets the line dash pattern in the page to solid line
HPDF_Page_SetLineWidth (page, 1.5) //sets the width of the line used to stroke a path
HPDF_Page_MoveTo (page, x, y) //starts a new subpath and move the current point for drawing path
HPDF_Page_CurveTo (page, x1, y1, x2, y2, x3, y3) //appends a Bézier curve to the current path using two spesified points
HPDF_Page_Stroke (page) //paints the current path