On this page
Guides
Cloud Border Style for Annotations
Users are allowed to set the border style of rectangular, circular, and polygonal annotations to a cloud-like pattern. The border style can also be changed between solid lines, dashed lines, or the cloud style. ComPDFKit provides convenient APIs for setting the cloud border style for annotations, along with demo demonstrations.
Here is an example code for adding a cloud-style border to a polygonal annotation:
c#
// Obtain the page object.
CPDFPage page = document.PageAtIndex(0);
// Create a polygonal annotation.
CPDFPolygonAnnotation polygon = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON) as CPDFPolygonAnnotation;
polygon.SetPoints(new List<CPoint> { new CPoint(100, 100), new CPoint(200, 100), new CPoint(200, 200), new CPoint(100, 200) });
polygon.SetRect(new CRect(100,200,200,100));
polygon.SetLineWidth(1);
polygon.SetLineColor(new byte[] { 255, 0, 0 });
// Set the border dashed style.
polygon.SetBorderStyle(C_BORDER_STYLE.BS_DASHDED, new float[]{2,1});
// Set the cloud border style.
CPDFBorderEffector borderEffector = new CPDFBorderEffector(C_BORDER_TYPE.C_BORDER_TYPE_Cloud, C_BORDER_INTENSITY.C_INTENSITY_ONE);
polygon.SetAnnotBorderEffector(borderEffector);
polygon.UpdateAp();
Cloud Border style Type Enumeration
Name | Description |
---|---|
C_INTENSITY_ZERO | The influence intensity ranges from 0 to 2, and when it is 0, it is a solid line |
C_INTENSITY_ONE | |
C_INTENSITY_TWO |
Name | Description |
---|---|
C_BORDER_TYPE_STRAIGHT | The border style style is a solid line |
C_BORDER_TYPE_Cloud | The border style style is cloud style |