Class PdfXfaPosition
Specifies the caption text position of fields
Inheritance
System.Object
PdfXfaPosition
Namespace: Syncfusion.Pdf.Xfa
Assembly: Syncfusion.Pdf.UWP.dll
Syntax
public sealed class PdfXfaPosition : 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
Bottom of the field
Declaration
public const PdfXfaPosition Bottom
Field Value
Type |
---|
PdfXfaPosition |
Left
Left side of the field
Declaration
public const PdfXfaPosition Left
Field Value
Type |
---|
PdfXfaPosition |
Right
Right side of the field
Declaration
public const PdfXfaPosition Right
Field Value
Type |
---|
PdfXfaPosition |
Top
Top of the field
Declaration
public const PdfXfaPosition Top
Field Value
Type |
---|
PdfXfaPosition |