Click or drag to resize

TextWidgetAnnotationMakeBasicAppearance Method

Makes the basic appearance for the annotation. Unlike CheckboxWidgetAnnotation, TextWidgetAnnotation can't easily share the same appearance since appearances are geometrically scaled to fit the bounds of the annotation. This means that border outlines will grow or shrink when drawn. When the Bounds of the annotation change, the appearance needs to be rebuilt in order to render correctly in the document. This method is provided so that, for example, client code might add in custom coloring or easily build consistent appearances for when the annotation has been cliecked on or when it is rolled over.

Namespace:  Atalasoft.PdfDoc.Generating.Annotations
Assembly:  Atalasoft.PdfDoc (in Atalasoft.PdfDoc.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public static string MakeBasicAppearance(
	GlobalResources gr,
	PdfBounds bounds,
	PdfTextAppearance app,
	double borderWidth,
	IPdfColor outlineColor,
	IPdfColor fillColor,
	string value,
	bool isMultiline,
	AnnotationTextAlignment annotationTextAlignment
)

Parameters

gr
Type: Atalasoft.PdfDoc.Generating.ResourceHandlingGlobalResources
The resources that will hold the appearance.
bounds
Type: Atalasoft.PdfDoc.GeometryPdfBounds
The bounds of the annotation.
app
Type: Atalasoft.PdfDoc.Generating.RenderingPdfTextAppearance
The text appearance for text in the widget.
borderWidth
Type: SystemDouble
Width of the border.
outlineColor
Type: Atalasoft.PdfDoc.GeneratingIPdfColor
Color of the outline.
fillColor
Type: Atalasoft.PdfDoc.GeneratingIPdfColor
Color of the fill.
value
Type: SystemString
The text value.
isMultiline
Type: SystemBoolean
A value indicating if this text can contain multiple lines.
annotationTextAlignment
Type: Atalasoft.PdfDoc.Generating.AnnotationsAnnotationTextAlignment
The horizontal alignment of the text.

Return Value

Type: String
A string which is the name of an template resource that will represent the annotation's appearance.
Examples
If you have AutoGenerateBasicAppearance set to true this method will be called as follows:
appearanceName = MakeBasicAppearance(resources, Bounds, DefaultAppearance, borderWidth,
    BorderColor ?? PdfColorFactory.FromGray(0), BackgroundColor ?? PdfColorFactory.FromGray(1), TextValue ?? "");
if (this.Appearance == null)
    this.Appearance = new AppearanceSet();
this.Appearance.Normal.Add(AppearanceSet.DefaultAppearanceName, appearanceName);
See Also