Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

DynaPDF.ClosePath

Closes current path.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 3.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.ClosePath"; PDF; FillMode )   More

Parameters

Parameter Description Example
PDF The PDF reference returned from DynaPDF.New. $pdf
FillMode Fill mode. Can be FillNoClose, StrokeNoClose, FillStrokeNoClose, Fill, Stroke, FillStroke, FillEvOdd, FillStrokeEvOdd, FillEvOddNoClose, FillStrokeEvOddNoClose, NoFill or Close. "fill"

Result

Returns OK or error message.

Description

Closes current path.
In PDF all vector graphics are paths. Paths can be filled, stroked, or both. Filled path can be drawn by applying the nonzero winding number rule or the even-odd rule (see Path Construction and Painting for further information). Both rules produce different results on complex paths but they have no effect on simple paths like rectangles, circles, and so on.
The filling rules are can be used to produce holes in a path; an area that is left unpainted. The draw direction is important when drawing simple shapes like rectangles and so on. See DynaPDF.SetDrawDirection for further information.
The flag NoFill can be used to discard a path that was already drawn.
Paths are invisible until they will be filled or stroked. DynaPDF displays a warning if an unused path is in memory when drawing an image, text, or when closing the page. The function checks whether a path is in memory prior execution. If no open path is detected the function returns with an error message.

See also ClosePath function in DynaPDF manual.

Examples

Draw triangle path:

# blue color
Set Variable [ $r ; Value: MBS("DynaPDF.SetFillColor"; $pdf; 0; 0; 1) ]
# go to start point
Set Variable [ $r ; Value: MBS("DynaPDF.MoveTo"; $pdf; 100; 100) ]
# add more points
Set Variable [ $r ; Value: MBS("DynaPDF.LineTo"; $pdf; 200; 100) ]
Set Variable [ $r ; Value: MBS("DynaPDF.LineTo"; $pdf; 100; 200) ]
# and fill
Set Variable [ $r ; Value: MBS("DynaPDF.ClosePath"; $pdf; "fill") ]

See also

Example Databases

Blog Entries

This function checks for a license.

Created 18th August 2014, last changed 7th March 2020


DynaPDF.CloseImportFile - DynaPDF.CloseTag