TextWidget: Vertical text alignment

Product: PDFNet.dll (PDFNet SDK for .NET)

Product Version: 9.4.8.503

The text alignment is vertical-centered.

using (PDFDoc doc = new PDFDoc())
{
	// Create a blank new page and add some form fields.
	Page blank_page = doc.PageCreate();

	// Text Widget Creation 
	TextWidget text1 = TextWidget.Create(doc, new Rect(100, 600, 350, 730));
	text1.SetText("Single-line Text ABC");
	text1.SetBorderColor(new ColorPt(0, 0, 0), 3);
	text1.RefreshAppearance();

	blank_page.AnnotPushBack(text1);

	doc.RefreshFieldAppearances();				

	doc.Save(output_path + "forms_test1.pdf", 0);
}

grafik

Is it possible that the text starts vertically at the top like this?
grafik

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi,

There is no simple way to change the vertical alignment as it is not defined with the PDF spec.

However, you can edit the appearance of the form field to achieve this manually, but you would need to modify it whenever you changed the text. For a guide on how to do this, view the following link: