DynaPDF Manual - Page 222

Previous Page 221   Index   Next Page 223

Function Reference
Page 222 of 860
false. If no font was already in use and if the property UseStdFonts is set to false it is not possible to
select a font until a new font search path was added (see AddFontSearchPath()).
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
ClipPath
Syntax:
SI32 pdfClipPath(
const PPDF* IPDF,
// Instance pointer
TClippingMode ClipMode, // Clipping mode (Winding or Even-Odd)
TPathFillMode FillMode) // Path fill mode
typedef enum
{
cmEvenOdd, // Use the Even-Odd rule
cmWinding
// Use the nonzero Winding Number rule
}TClippingMode;
typedef enum
{
fmFillNoClose,
// not allowed, path must be closed
fmStrokeNoClose,
// not allowed, path must be closed
fmFillStrokeNoClose,
// not allowed, path must be closed
fmFill,
// fill the path (winding)
fmStroke,
// stroke the path (winding)
fmFillStroke,
// fill and stroke the path (winding)
fmFillEvOdd,
// fill the path (even-odd)
fmFillStrokeEvOdd,
// fill and stroke the path (even-odd)
fmFillEvOddNoClose,
// not allowed, path must be closed
fmFillStrokeEvOddNoClose, // not allowed, path must be closed
fmNoFill,
// close but do not paint the path
fmClose
// same as fmNoFill
}TPathFillMode;
This function marks the current path as clipping path. The function must be called after a closable
path was created. A path that consists of a MoveTo() and LineTo() only call cannot be closed!
A clipping path can also be filled, stroked, or both in one pass. However, the combination of a
clipping path operator with a path painting operator is seldom used and not supported in all PDF
viewers. To avoid unnecessary problems a path should always be clipped and painted in two
separate steps, also if this causes some unnecessary overhead.
Once the clipping was created and activated with ClipPath() you can draw arbitrary contents into it,
such as images, text, or vector graphics.
A clipping path is part of the current graphics state. The only way to deactivate a clipping path is to
restore the graphics state with RestoreGraphicState(). This assumes that it was saved with
SaveGraphicState() before the clipping path was created.
Note that it is not possible to extend or widen an active clipping path. It is only possible to intersect
it with a new one. The intersection of two clipping paths is never larger than the initial clipping
path.
 

Previous topic: ClearAutoTemplates, ClearErrorLog, ClearHostFonts

Next topic: CloseAndSignFile, Importing signed PDF files