Click or drag to resize
Pdftools logo

PolygonAnnotationCreate Method

Create a polygon annotation.

The returned polygon annotation is not yet part of any page. It can be added to a page's list of annotations.

Namespace: PdfTools.FourHeights.PdfToolbox.Pdf.Annotations
Assembly: PdfTools.FourHeights.PdfToolbox (in PdfTools.FourHeights.PdfToolbox.dll) Version: 4.4.1+cd45f416896d630bcd3719f4b2cba7920f2790da
Syntax
C#
public static PolygonAnnotation Create(
	Document targetDocument,
	Path path,
	Stroke stroke,
	Paint fill
)

Parameters

targetDocument  Document
The output document with which the returned object is associated.
path  Path
The path of the polygon.
stroke  Stroke
The stroking parameters used for stroking the polygon. The stroking paint is used as the annotation's main paint. If then the polygon is not filled.
fill  Paint
The paint used for filling the polygon. If then the polygon is not filled.

Return Value

PolygonAnnotation
The newly created polygon annotation.
Exceptions
ExceptionCondition
ArgumentExceptionif the targetDocument has already been closed
ArgumentExceptionif the targetDocument is read-only
ArgumentExceptionif the path argument has not been constructed with a PathGenerator
ArgumentExceptionif the targetDocument's conformance is not PDF 2.0 and the path argument contains curve-to operations
ArgumentExceptionif the path argument contains close-subpath or rectangle operations
UnsupportedFeatureExceptionif the targetDocument's conformance is PDF 2.0 and the path argument contains curve-to operations
ArgumentExceptionif the stroke and fill arguments are both
ArgumentExceptionif the stroke argument is not associated with targetDocument
ArgumentExceptionif the stroke's Paint has a ColorSpace other than a device color space
ArgumentExceptionif the stroke's Paint has a non-Transparency with BlendMode other than Normal
ArgumentExceptionif the stroke argument's LineCapStyle is other than Butt
ArgumentExceptionif the stroke argument's LineJoinStyle is other than Miter
ArgumentExceptionif the stroke argument's MiterLimit is other than 10
ArgumentExceptionif the stroke argument's DashPhase is other than 0
ArgumentExceptionif the fill has a ColorSpace other than a device color space
ArgumentExceptionif the fill has a non-Transparency with BlendMode other than Normal
ArgumentExceptionif the fill argument is not associated with the targetDocument
ConformanceExceptionif the explicitly requested PDF conformance is smaller than PDF 1.5
ArgumentNullExceptionif targetDocument is .
ArgumentNullExceptionif path is .
See Also