Product: PDFNet.dll (PDFNet SDK for .NET)
Product Version: 9.4.8.503
The starting position of the text is different
Add two Fields/TextWidgets with the Multiline flag and set a multiline text to the first TextWidget and a single-line text to the second TextWidget.
The postion of the multiline text is some Twips/Pixel above of the postion of the single-line text.
using (PDFDoc doc = new PDFDoc())
{
// Create a blank new page and add some form fields.
Page blank_page = doc.PageCreate();
// Text Widget Creation
Field field1 = doc.FieldCreate("basicone", Field.Type.e_text);
field1.SetFlag(Field.Flag.e_multiline, true);
TextWidget text1 = TextWidget.Create(doc, new Rect(100, 700, 350, 730), field1);
System.Text.StringBuilder basicText1 = new System.Text.StringBuilder();
basicText1.AppendLine("Line #1");
basicText1.Append("Line #2");
text1.SetText(basicText1.ToString());
text1.SetBorderColor(new ColorPt(0, 0, 0), 3);
text1.RefreshAppearance();
blank_page.AnnotPushBack(text1);
Field field2 = doc.FieldCreate("basictwo", Field.Type.e_text);
field2.SetFlag(Field.Flag.e_multiline, true);
TextWidget text2 = TextWidget.Create(doc, new Rect(100, 650, 350, 680), field2);
System.Text.StringBuilder basicText2 = new System.Text.StringBuilder();
basicText2.Append("Line #1");
text2.SetText(basicText2.ToString());
text2.SetBorderColor(new ColorPt(0, 0, 0), 3);
text2.RefreshAppearance();
blank_page.AnnotPushBack(text2);
// Add the page as the last page in the document.
doc.PagePushBack(blank_page);
doc.RefreshFieldAppearances();
doc.Save(output_path + "forms_test1.pdf", 0);
}
It would be nice, if all texts start at the exact same relative position.