Class PdfXfaDocument
Represents the XFA document
Inheritance
System.Object
PdfXfaDocument
Implements
System.ICloneable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.Pdf.Xfa
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfXfaDocument : ICloneable
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaDateTimeField field = new PdfXfaDateTimeField("dateTime1", new SizeF(100, 30));
//Set the default value
field.Value = DateTime.Now;
//Add the field to the form
form.Fields.Add(field);
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
'Create a new XFA Field
Dim field As New PdfXfaDateTimeField("dateTime1", New SizeF(100, 30))
'Set the default value
field.Value = DateTime.Now
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Constructors
PdfXfaDocument()
Initialize a new instance of the PdfXfaDocument class.
Declaration
public PdfXfaDocument()
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaDateTimeField field = new PdfXfaDateTimeField("dateTime1", new SizeF(100, 30));
//Set the default value
field.Value = DateTime.Now;
//Add the field to the form
form.Fields.Add(field);
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
'Create a new XFA Field
Dim field As New PdfXfaDateTimeField("dateTime1", New SizeF(100, 30))
'Set the default value
field.Value = DateTime.Now
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Properties
FormName
Gets or sets the form name.
Declaration
public string FormName { get; set; }
Property Value
Type |
---|
System.String |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Set form name.
document.FormName = "topmostform";
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaDateTimeField field = new PdfXfaDateTimeField("dateTime1", new SizeF(100, 30));
//Set the default value
field.Value = DateTime.Now;
//Add the field to the form
form.Fields.Add(field);
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Set form name.
document.FormName = "topmostform"
'Create a new XFA form
Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
'Create a new XFA Field
Dim field As New PdfXfaDateTimeField("dateTime1", New SizeF(100, 30))
'Set the default value
field.Value = DateTime.Now
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Pages
Get the XFA page
Declaration
public PdfXfaPageCollection Pages { get; }
Property Value
Type |
---|
PdfXfaPageCollection |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage page = document.Pages.Add();
//Set form name.
document.FormName = "topmostform";
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaDateTimeField field = new PdfXfaDateTimeField("dateTime1", new SizeF(100, 30));
//Set the default value
field.Value = DateTime.Now;
//Add the field to the form
form.Fields.Add(field);
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim page As PdfXfaPage = document.Pages.Add()
'Set form name.
document.FormName = "topmostform"
'Create a new XFA form
Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
'Create a new XFA Field
Dim field As New PdfXfaDateTimeField("dateTime1", New SizeF(100, 30))
'Set the default value
field.Value = DateTime.Now
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
PageSettings
Gets or set page settings.
Declaration
public PdfXfaPageSettings PageSettings { get; set; }
Property Value
Type |
---|
PdfXfaPageSettings |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new PDF XFA page settings instance.
PdfXfaPageSettings settings = new PdfXfaPageSettings();
//Set margin.
settings.Margins.All = 40;
//Set page orientation.
settings.PageOrientation = PdfXfaPageOrientation.Landscape;
//Set page size.
settings.PageSize = new SizeF(new SizeF(500, 700));
//Set page settings to document.
document.PageSettings = settings;
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaDateTimeField field = new PdfXfaDateTimeField("dateTime1", new SizeF(100, 30));
//Set the default value
field.Value = DateTime.Now;
//Add the field to the form
form.Fields.Add(field);
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new PDF XFA page settings instance.
Dim settings As New PdfXfaPageSettings()
'Set margin.
settings.Margins.All = 40
'Set page orientation.
settings.PageOrientation = PdfXfaPageOrientation.Landscape
'Set page size.
settings.PageSize = New SizeF(New SizeF(500, 700))
'Set page settings to document.
document.PageSettings = settings
'Create a new XFA form
Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
'Create a new XFA Field
Dim field As New PdfXfaDateTimeField("dateTime1", New SizeF(100, 30))
'Set the default value
field.Value = DateTime.Now
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
XfaForm
Gets or sets the XFA form
Declaration
public PdfXfaForm XfaForm { get; set; }
Property Value
Type |
---|
PdfXfaForm |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaDateTimeField field = new PdfXfaDateTimeField("dateTime1", new SizeF(100, 30));
//Set the default value
field.Value = DateTime.Now;
//Add the field to the form
form.Fields.Add(field);
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
'Create a new XFA Field
Dim field As New PdfXfaDateTimeField("dateTime1", New SizeF(100, 30))
'Set the default value
field.Value = DateTime.Now
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Methods
Clone()
Clone
Declaration
public object Clone()
Returns
Type |
---|
System.Object |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaDateTimeField field = new PdfXfaDateTimeField("dateTime1", new SizeF(100, 30));
//Set the default value
field.Value = DateTime.Now;
//Add the field to the form
form.Fields.Add(field);
document.XfaForm = form;
//Clone the document.
PdfXfaDocument cDocument = document.Clone() as PdfXfaDocument;
//Save the document
cDocument.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
cDocument.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
'Create a new XFA Field
Dim field As New PdfXfaDateTimeField("dateTime1", New SizeF(100, 30))
'Set the default value
field.Value = DateTime.Now
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
'Clone the document.
PdfXfaDocument cDocument = TryCast(document.Clone(), PdfXfaDocument)
'Save the document
cDocument.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
cDocument.Close()
Close()
Close the document
Declaration
public void Close()
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaDateTimeField field = new PdfXfaDateTimeField("dateTime1", new SizeF(100, 30));
//Set the default value
field.Value = DateTime.Now;
//Add the field to the form
form.Fields.Add(field);
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
'Create a new XFA Field
Dim field As New PdfXfaDateTimeField("dateTime1", New SizeF(100, 30))
'Set the default value
field.Value = DateTime.Now
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Save(Stream, PdfXfaType)
save the document
Declaration
public void Save(Stream stream, PdfXfaType type)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The output stream. |
PdfXfaType | type | The xfa form type. |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaDateTimeField field = new PdfXfaDateTimeField("dateTime1", new SizeF(100, 30));
//Set the default value
field.Value = DateTime.Now;
//Add the field to the form
form.Fields.Add(field);
document.XfaForm = form;
MemoryStream stream = new MemoryStream();
//Save the document
document.Save(stream, PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
'Create a new XFA Field
Dim field As New PdfXfaDateTimeField("dateTime1", New SizeF(100, 30))
'Set the default value
field.Value = DateTime.Now
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
Dim stream As MemoryStream = New MemoryStream()
'Save the document
document.Save(stream, PdfXfaType.Dynamic)
'Close the document
document.Close()
Save(Stream, PdfXfaType, HttpContext)
Save the document
Declaration
public void Save(Stream stream, PdfXfaType type, HttpContext response)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream where to save the document. |
PdfXfaType | type | The type of the XFA form. |
System.Web.HttpContext | response | The HTTP response stream object. |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaDateTimeField field = new PdfXfaDateTimeField("dateTime1", new SizeF(100, 30));
//Set the default value
field.Value = DateTime.Now;
//Add the field to the form
form.Fields.Add(field);
document.XfaForm = form;
MemoryStream stream = new MemoryStream();
//Save the document
document.Save(stream, PdfXfaType.Dynamic, Response);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
'Create a new XFA Field
Dim field As New PdfXfaDateTimeField("dateTime1", New SizeF(100, 30))
'Set the default value
field.Value = DateTime.Now
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
Dim stream As MemoryStream = New MemoryStream()
'Save the document
document.Save(stream, PdfXfaType.Dynamic, Response)
'Close the document
document.Close()
Save(String, PdfXfaType)
Save the document
Declaration
public void Save(string fileName, PdfXfaType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The output file name. |
PdfXfaType | type | The XFA form type. |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaDateTimeField field = new PdfXfaDateTimeField("dateTime1", new SizeF(100, 30));
//Set the default value
field.Value = DateTime.Now;
//Add the field to the form
form.Fields.Add(field);
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
'Create a new XFA Field
Dim field As New PdfXfaDateTimeField("dateTime1", New SizeF(100, 30))
'Set the default value
field.Value = DateTime.Now
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Save(String, PdfXfaType, HttpResponse, HttpReadType)
Save the document
Declaration
public void Save(string fileName, PdfXfaType type, HttpResponse response, HttpReadType httpType)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The name of the document. |
PdfXfaType | type | The type of the XFA form. |
System.Web.HttpResponse | response | The HTTP response stream object. |
HttpReadType | httpType | The type of the reading document. |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaDateTimeField field = new PdfXfaDateTimeField("dateTime1", new SizeF(100, 30));
//Set the default value
field.Value = DateTime.Now;
//Add the field to the form
form.Fields.Add(field);
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic, Response, HttpReadType.Open);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
'Create a new XFA Field
Dim field As New PdfXfaDateTimeField("dateTime1", New SizeF(100, 30))
'Set the default value
field.Value = DateTime.Now
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic, Response, HttpReadType.Open)
'Close the document
document.Close()
Implements
System.ICloneable