PDFPAGE_EoClip
IPDFDocument3 :: PDF page methods

See Also Example
Collapse All

This method sets the current path as a clipping boundary using an even-odd rule.

Syntax

HRESULT PDFPAGE_EoClip ()
Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.

Remarks

This method sets the current path as the boundary for clipping subsequent drawings. The use of the clip operator may require some care, because clip operators do not use the current path. Also note that there is no practical way of removing a clipping path, except by using PDFPAGE_GStateRestore before clipping. This methods uses an even-odd rule for defining the "path inside".

Equivalent in new interface: IPDFDocument4::AlternateClip.

Example

How to Draw Text in a Clipped Region

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;
{ create clip region as circle }
PDF.PDFPAGE_Circle(100, 100, 80);
PDF.PDFPAGE_Circle(140, 160, 80);
PDF.PDFPAGE_EoClip;
{ now region is clipped, draw a text }
PDF.PDFPAGE_SetActiveFont('Verdana', false, false, false, false, 12.0, 0);
for i := 1 To 20 do
begin
    PDF.PDFPAGE_TextOut(10, 15*i, 0.0, 'text text text text text text text text text');
end;
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();
// create clip region as circle
PDF->PDFPAGE_Circle(100, 100, 80);
PDF->PDFPAGE_Circle(140, 160, 80);
PDF->PDFPAGE_EoClip();
// now region is clipped, draw a text
PDF->PDFPAGE_SetActiveFont("Verdana", false, false, false, false, 12.0, 0);
for (int i = 0; i < 21; i++)
    PDF->PDFPAGE_TextOut(10, 15*i, 0.0, "text text text text text text text text text");
PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();
// create clip region as circle
PDF.PDFPAGE_Circle(100, 100, 80);
PDF.PDFPAGE_Circle(140, 160, 80);
PDF.PDFPAGE_EoClip();
// now region is clipped, draw a text
PDF.PDFPAGE_SetActiveFont("Verdana", false, false, false, false, 12.0, 0);
for (int i = 0; i < 21; i++)
    PDF.PDFPAGE_TextOut(10, 15*i, 0.0, "text text text text text text text text text");
PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.BeginDoc
' create clip region as circle
PDF.PDFPAGE_Circle 100, 100, 80
PDF.PDFPAGE_Circle 140, 160, 80
PDF.PDFPAGE_EoClip
' now region is clipped, draw a text
PDF.PDFPAGE_SetActiveFont "Verdana", False, False, False, False, 12.0, 0
For i = 1 To 20
    PDF.PDFPAGE_TextOut 10, 15*i, 0.0, "text text text text text text text text text"
Next
PDF.EndDoc

See Also

Reference