Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
PDF Creator Pilot 3 Knowledge Base
How to Manipulate Primitives to Clip Drawing Objects

See Also
Collapse All

You can manipulate primitives to clip pictures:

1. Create a path that will clip a future picture. Be sure that the path is closed.

Delphi :

PDF.PDFPAGE_NewPath;
PDF.PDFPAGE_Ellipse(50, 100, PDF.PDFPAGE_Width - 50, PDF.PDFPAGE_Height - 50);
PDF.PDFPAGE_ClosePath;

Visual Basic or Visual Basic Script :

PDF.PDFPAGE_NewPath 
PDF.PDFPAGE_Ellipse 50, 100, PDF.PDFPAGE_Width - 50, PDF.PDFPAGE_Height - 50
PDF.PDFPAGE_ClosePath 

C/C++ :

PDF->PDFPAGE_NewPath();
PDF->PDFPAGE_Ellipse(50, 100, PDF->PDFPAGE_Width - 50, PDF->PDFPAGE_Height - 50);
PDF->PDFPAGE_ClosePath();

C# :

PDF.PDFPAGE_NewPath();
PDF.PDFPAGE_Ellipse(50, 100, PDF.PDFPAGE_Width - 50, PDF.PDFPAGE_Height - 50);
PDF.PDFPAGE_ClosePath();

2. Set the current path as the clipping path.

Delphi :

PDF.PDFPAGE_Clip;

Visual Basic or Visual Basic Script :

PDF.PDFPAGE_Clip 

C/C++ :

PDF->PDFPAGE_Clip();

C# :

PDF.PDFPAGE_Clip();

3. Draw other objects or pictures using a new path.

Delphi :

PDF.PDFPAGE_NewPath;
PDF.PDFPAGE_SetRGBColor(0, 0, 0.5);
PDF.PDFPAGE_Ellipse(0, 0, PDF.PDFPAGE_Width, PDF.PDFPAGE_Height);
{ Ellipse filled in page }

Visual Basic or Visual Basic Script :

PDF.PDFPAGE_NewPath 
PDF.PDFPAGE_SetRGBColor 0, 0, 0.5 
PDF.PDFPAGE_Ellipse 0, 0, PDF.PDFPAGE_Width, PDF.PDFPAGE_Height 'Ellipse filled in page

C/C++ :

PDF.PDFPAGE_NewPath();
PDF.PDFPAGE_SetRGBColor(0, 0, 0.5f);
PDF.PDFPAGE_Ellipse(0, 0, PDF->PDFPAGE_Width, PDF.->DFPAGE_Height); // Ellipse filled in page

C# :

PDF.PDFPAGE_NewPath();
PDF.PDFPAGE_SetRGBColor(0, 0, 0.5f);
PDF.PDFPAGE_Ellipse(0, 0, PDF.PDFPAGE_Width, PDF.PDFPAGE_Height); // Ellipse filled in page

4. Stroke your picture and it will be clipped by the clipping path.

Delphi :

PDF.PDFPAGE_FillAndStroke;

Visual Basic or Visual Basic Script :

PDF.PDFPAGE_FillAndStroke 

C/C++ :

PDF->PDFPAGE_FillAndStroke();

C# :

PDF.PDFPAGE_FillAndStroke();

For more details see PDFPAGE_ClipPDFPAGE_EoClip, PDFPAGE_ClosePath, PDFPAGE_NewPath.

Note: You cannot reset the clipping path. Use PDFPAGE_GStateSave and PDFPAGE_GStateRestore to save and restore the graphical state and clipping region.

See Also

Reference

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots