Click or drag to resize
Pdftools logo

FreeTextCreate Method

Create a free-text annotation.

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

Namespace: PdfTools.Toolbox.Pdf.Annotations
Assembly: PdfTools.Toolbox (in PdfTools.Toolbox.dll) Version: 1.4.0+02318d3e3f9645a1305b87026fb971a660079e54
Syntax
C#
public static FreeText Create(
	Document targetDocument,
	Rectangle boundingBox,
	string content,
	Paint paint,
	Stroke stroke = null
)

Parameters

targetDocument  Document
The output document with which the returned object is associated.
boundingBox  Rectangle
The location on the page.
content  String
The text content.
paint  Paint
This paint used for the background of the free text annotation. If , the background is transparent.
stroke  Stroke  (Optional)
The stroking parameters used for stroking the rectangle. The stroking paint is used as the annotation's main paint.

Return Value

FreeText
The newly created free text annotation.
Exceptions
ExceptionCondition
ArgumentExceptionif the targetDocument has already been closed
ArgumentExceptionif the targetDocument is read-only
ArgumentExceptionif the paint has a ColorSpace other than a device color space
ArgumentExceptionif the paint has a non-Transparency with BlendMode other than Normal
ArgumentExceptionif the paint argument is not associated with the 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's LineCapStyle is other than Butt
ArgumentExceptionif the stroke's LineJoinStyle is other than Miter
ArgumentExceptionif the stroke's MiterLimit is other than 10
ArgumentExceptionif the stroke's DashPhase is other than 0
ArgumentNullExceptionif targetDocument is .
See Also