Class PdfXfaVerticalAlignment
Specifies the Vertical alignment
Inheritance
System.Object
PdfXfaVerticalAlignment
Namespace: Syncfusion.Pdf.Xfa
Assembly: Syncfusion.Pdf.UWP.dll
Syntax
public sealed class PdfXfaVerticalAlignment : Enum
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Create new XFA caption instance.
PdfXfaCaption caption = new PdfXfaCaption();
//Set caption text.
caption.Text = "First Name";
//Set the caption font.
caption.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set the caption fore color.
caption.ForeColor = new PdfColor(Color.Red);
//Set the horizontal alignment.
caption.HorizontalAlignment = PdfXfaHorizontalAlignment.Center;
//Set the vertical alignment.
caption.VerticalAlignment = PdfXfaVerticalAlignment.Middle;
//Set the caption position.
caption.Position = PdfXfaPosition.Left;
//Set the caption reserved width.
caption.Width = 100;
//Set the caption to text box.
textBoxField.Caption = caption;
//Set the tool tip.
textBoxField.ToolTip = "First Name";
//Add the field to the XFA form.
mainForm.Fields.Add(textBoxField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a textbox field and add the properties.
Dim textBoxField As New PdfXfaTextBoxField("FirstName", New SizeF(200, 20))
'Create new XFA caption instance.
Dim caption As New PdfXfaCaption()
'Set caption text.
caption.Text = "First Name"
'Set the caption font.
caption.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
'Set the caption fore color.
caption.ForeColor = New PdfColor(Color.Red)
'Set the horizontal alignment.
caption.HorizontalAlignment = PdfXfaHorizontalAlignment.Center
'Set the vertical alignment.
caption.VerticalAlignment = PdfXfaVerticalAlignment.Middle
'Set the caption position.
caption.Position = PdfXfaPosition.Left
'Set the caption reserved width.
caption.Width = 100
'Set the caption to text box.
textBoxField.Caption = caption
'Set the tool tip.
textBoxField.ToolTip = "First Name"
'Add the field to the XFA form.
mainForm.Fields.Add(textBoxField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()
Fields
Bottom
Specifies the element is aligned to Bottom.
Declaration
public const PdfXfaVerticalAlignment Bottom
Field Value
Type |
---|
PdfXfaVerticalAlignment |
Middle
Specifies the element is aligned to Middle.
Declaration
public const PdfXfaVerticalAlignment Middle
Field Value
Type |
---|
PdfXfaVerticalAlignment |
Top
Specifies the element is aligned to Top.
Declaration
public const PdfXfaVerticalAlignment Top
Field Value
Type |
---|
PdfXfaVerticalAlignment |