menu

UWP

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfLoadedXfaDateTimeField - UWP API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfLoadedXfaDateTimeField

    Represents the loaded date time field of the XFA form.

    Inheritance
    System.Object
    PdfXfaField
    PdfLoadedXfaField
    PdfLoadedXfaStyledField
    PdfLoadedXfaDateTimeField
    Inherited Members
    PdfLoadedXfaStyledField.Border
    PdfLoadedXfaStyledField.Caption
    PdfLoadedXfaStyledField.Font
    PdfLoadedXfaStyledField.ForeColor
    PdfLoadedXfaStyledField.Height
    PdfLoadedXfaStyledField.HorizontalAlignment
    PdfLoadedXfaStyledField.Location
    PdfLoadedXfaStyledField.ReadOnly
    PdfLoadedXfaStyledField.ToolTip
    PdfLoadedXfaStyledField.VerticalAlignment
    PdfLoadedXfaStyledField.Width
    PdfXfaField.Margins
    PdfXfaField.Name
    PdfXfaField.Visibility
    Namespace: Syncfusion.Pdf.Xfa
    Assembly: Syncfusion.Pdf.UWP.dll
    Syntax
    public class PdfLoadedXfaDateTimeField : PdfLoadedXfaStyledField
    Examples
    //Load the existing PDF document
    PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
    //Load the existing XFA form
    PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
    //Get the loaded date time field.
    PdfLoadedXfaDateTimeField loadedDateTimeField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["dateTimeField[0]"] as PdfLoadedXfaDateTimeField;
    //Set the value
    loadedDateTimeField.Value = DateTime.Now;
    //Save the document
    loadedDocument.Save("output.pdf");
    //Close the document
    loadedDocument.Close();
    'Load the existing PDF document
    Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
    'Load the existing XFA form
    Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
    'Get the loaded date time field.
    Dim loadedDateTimeField As PdfLoadedXfaDateTimeField = TryCast((TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm)).Fields("dateTimeField[0]"), PdfLoadedXfaDateTimeField)
    'Set the value           
    loadedDateTimeField.Value = Date.Now
    'Save the document 
    loadedDocument.Save("output.pdf")
    'Close the document
    loadedDocument.Close()

    Constructors

    PdfLoadedXfaDateTimeField()

    Declaration
    public PdfLoadedXfaDateTimeField()

    Properties

    Format

    Get or sets the date field format

    Declaration
    public PdfXfaDateTimeFormat Format { get; set; }
    Property Value
    Type
    PdfXfaDateTimeFormat
    Examples
    //Load the existing PDF document
    PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
    //Load the existing XFA form
    PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
    //Get the loaded date time field.
    PdfLoadedXfaDateTimeField loadedDateTimeField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["dateTimeField[0]"] as PdfLoadedXfaDateTimeField;
    //Set the value
    loadedDateTimeField.Value = DateTime.Now;
    //Get the date time format.
    PdfXfaDateTimeFormat format = loadedDateTimeField.Format;
    //Save the document
    loadedDocument.Save("output.pdf");
    //Close the document
    loadedDocument.Close();
    'Load the existing PDF document
    Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
    'Load the existing XFA form
    Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
    'Get the loaded date time field.
    Dim loadedDateTimeField As PdfLoadedXfaDateTimeField = TryCast((TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm)).Fields("dateTimeField[0]"), PdfLoadedXfaDateTimeField)
    'Set the value           
    loadedDateTimeField.Value = Date.Now
    'Get the date time format.
    Dim format As PdfXfaDateTimeFormat = loadedDateTimeField.Format
    'Save the document 
    loadedDocument.Save("output.pdf")
    'Close the document
    loadedDocument.Close()

    Pattern

    Gets or set the date field pattern

    Declaration
    public string Pattern { get; set; }
    Property Value
    Type
    System.String
    Examples
    //Load the existing PDF document
    PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
    //Load the existing XFA form
    PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
    //Get the loaded date time field.
    PdfLoadedXfaDateTimeField loadedDateTimeField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["dateTimeField[0]"] as PdfLoadedXfaDateTimeField;
    //Set the value
    loadedDateTimeField.Value = DateTime.Now;
    //Set the pattern.
    loadedDateTimeField.Pattern = "date{MMMM DD, YYYY}";
    //Save the document
    loadedDocument.Save("output.pdf");
    //Close the document
    loadedDocument.Close();
    'Load the existing PDF document
    Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
    'Load the existing XFA form
    Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
    'Get the loaded date time field.
    Dim loadedDateTimeField As PdfLoadedXfaDateTimeField = TryCast((TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm)).Fields("dateTimeField[0]"), PdfLoadedXfaDateTimeField)
    'Set the value           
    loadedDateTimeField.Value = Date.Now
    'Set the pattern.
    loadedDateTimeField.Pattern = "date{MMMM DD, YYYY}"
    'Save the document 
    loadedDocument.Save("output.pdf")
    'Close the document
    loadedDocument.Close()

    Value

    Gets or sets the date time

    Declaration
    public DateTime Value { get; set; }
    Property Value
    Type
    System.DateTime
    Examples
    //Load the existing PDF document
    PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
    //Load the existing XFA form
    PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
    //Get the loaded date time field.
    PdfLoadedXfaDateTimeField loadedDateTimeField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["dateTimeField[0]"] as PdfLoadedXfaDateTimeField;
    //Set the value
    loadedDateTimeField.Value = DateTime.Now;
    //Save the document
    loadedDocument.Save("output.pdf");
    //Close the document
    loadedDocument.Close();
    'Load the existing PDF document
    Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
    'Load the existing XFA form
    Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
    'Get the loaded date time field.
    Dim loadedDateTimeField As PdfLoadedXfaDateTimeField = TryCast((TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm)).Fields("dateTimeField[0]"), PdfLoadedXfaDateTimeField)
    'Set the value           
    loadedDateTimeField.Value = Date.Now
    'Save the document 
    loadedDocument.Save("output.pdf")
    'Close the document
    loadedDocument.Close()

    Methods

    ClearValue()

    Clear the DateTime field value. By doing this, the DateTime field will be set to empty.

    Declaration
    public void ClearValue()
    Examples
    //Load the existing PDF document
    PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
    //Load the existing XFA form
    PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
    //Get the loaded date time field.
    PdfLoadedXfaDateTimeField loadedDateTimeField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["dateTimeField[0]"] as PdfLoadedXfaDateTimeField;
    //Clear the value
    loadedDateTimeField.ClearValue();+        /// //Save the document
    loadedDocument.Save("output.pdf");
    //Close the document
    loadedDocument.Close();
    'Load the existing PDF document
    Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
    'Load the existing XFA form
    Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
    'Get the loaded date time field.
    Dim loadedDateTimeField As PdfLoadedXfaDateTimeField = TryCast((TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm)).Fields("dateTimeField[0]"), PdfLoadedXfaDateTimeField)
    'Clear the value           
    loadedDateTimeField.ClearValue()
    'Save the document 
    loadedDocument.Save("output.pdf")
    'Close the document
    loadedDocument.Close()

    Extension Methods

    DateTimeExtension.ToDateTime(Object)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved