We are trying to set the vertical alignment of a form text box, but setting the property doesn’t seem to have any effect. We have tried on both multiline and single line boxes. Using one of the Aspose samples we boiled it down to a pretty simple test:
// Open document
var dataDir = @"C:\inetpub\wwwroot\CSS\CsS.Scratch\";
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(dataDir + "TextField.pdf");
// Create a field
TextBoxField textBoxField = new TextBoxField(pdfDocument.Pages[1], new Aspose.Pdf.Rectangle(100, 200, 400, 400));
textBoxField.PartialName = "textbox1";
textBoxField.Value = "Text Box Line 1" + Environment.NewLine + "Line 2";
// TextBoxField.Border = new Border(
Border border = new Border(textBoxField);
border.Width = 5;
border.Dash = new Dash(1, 1);
textBoxField.Border = border;
textBoxField.Multiline = true;
textBoxField.VerticalAlignment = VerticalAlignment.Bottom;
// Add field to the document
pdfDocument.Form.Add(textBoxField, 1);
dataDir = dataDir + "TextBox_out.pdf";
// Save modified PDF
pdfDocument.Save(dataDir);
Multiline textboxes always seem to display the text at the top and single line textboxes always seem to vertically align center.
Any help is appreciated.
Thanks,
Scott