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: (.NET 4.5.2, x86)
public static string MakeBasicAppearance(
	GlobalResources gr,
	PdfBounds bounds,
	PdfTextAppearance app,
	double borderWidth,
	IPdfColor outlineColor,
	IPdfColor fillColor,
	string value,
	bool isMultiline,
	AnnotationTextAlignment annotationTextAlignment


Type: Atalasoft.PdfDoc.Generating.ResourceHandlingGlobalResources
The resources that will hold the appearance.
Type: Atalasoft.PdfDoc.GeometryPdfBounds
The bounds of the annotation.
Type: Atalasoft.PdfDoc.Generating.RenderingPdfTextAppearance
The text appearance for text in the widget.
Type: SystemDouble
Width of the border.
Type: Atalasoft.PdfDoc.GeneratingIPdfColor
Color of the outline.
Type: Atalasoft.PdfDoc.GeneratingIPdfColor
Color of the fill.
Type: SystemString
The text value.
Type: SystemBoolean
A value indicating if this text can contain multiple lines.
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.
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("N", appearanceName);
See Also