PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllSets the current path as a clipping boundary using an even-odd rule.
|
| 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 installs the current paths as the boundary for clipping subsequent drawings. The use of the clip operator may require some care, because clip operator 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".
Analogue in new interface: IPDFDocument4::AlternateClip.
Example
How to draw text in 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


