Class PdfCreationDateField
Represents class to display creation date of the document.
Inheritance
Inherited Members
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.UWP.dll
Syntax
public class PdfCreationDateField : PdfSingleValueField
Examples
//Create a new document.
PdfDocument doc = new PdfDocument();
//Create a new page.
PdfPage page = doc.Pages.Add();
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
PdfBrush brush = PdfBrushes.Black;
//Creates Date time field.
PdfCreationDateField dateTimeField = new PdfCreationDateField(font);
for (int i = 0; i!=3; i++)
{
page = doc.Pages.Add();
dateTimeField.Draw(page.Graphics);
}
//Save and close the document.
doc.Save("DateTimeField.pdf");
doc.Close(true);
'Create a new document.
Dim doc As New PdfDocument()
'Create a new page.
Dim page As PdfPage = doc.Pages.Add()
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12F)
Dim brush As PdfBrush = PdfBrushes.Black
'Creates Date time field.
Dim dateTimeField As New PdfCreationDateField(font)
For i As Integer = 0 To 2
page = doc.Pages.Add()
dateTimeField.Draw(page.Graphics)
Next
'Save and close the document.
doc.Save("DateTimeField.pdf")
doc.Close(True)
Constructors
PdfCreationDateField()
Initializes a new instance of the PdfCreationDateField class.
Declaration
public PdfCreationDateField()
Examples
// Create a new document
PdfDocument doc = new PdfDocument();
//Create a new page
PdfPage page = doc.Pages.Add();
// Creates Date time field
PdfCreationDateField dateTimeField = new PdfCreationDateField();
for (int i = 0; i!=3; i++)
{
page = doc.Pages.Add();
dateTimeField.Draw(page.Graphics);
}
//Save and close the document
doc.Save("DateTimeField.pdf");
doc.Close(true);
'Create a new document.
Dim doc As New PdfDocument()
'Create a new page.
Dim page As PdfPage = doc.Pages.Add()
'Creates Date time field.
Dim dateTimeField As New PdfCreationDateField()
For i As Integer = 0 To 2
page = doc.Pages.Add()
dateTimeField.Draw(page.Graphics)
Next
'Save and close the document.
doc.Save("DateTimeField.pdf")
doc.Close(True)
PdfCreationDateField(PdfFont)
Initializes a new instance of the PdfCreationDateField class with PdfFont
Declaration
public PdfCreationDateField(PdfFont font)
Parameters
Type | Name | Description |
---|---|---|
PdfFont | font | A PdfFont object that specifies the font attributes (the family name, the size, and the style of the font) to use. |
Examples
// Create a new document
PdfDocument doc = new PdfDocument();
//Create a new page
PdfPage page = doc.Pages.Add();
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
PdfBrush brush = PdfBrushes.Black;
// Creates Date time field
PdfCreationDateField dateTimeField = new PdfCreationDateField(font);
for (int i = 0; i!=3; i++)
{
page = doc.Pages.Add();
dateTimeField.Draw(page.Graphics);
}
//Save and close the document
doc.Save("DateTimeField.pdf");
doc.Close(true);
'Create a new document.
Dim doc As New PdfDocument()
'Create a new page.
Dim page As PdfPage = doc.Pages.Add()
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12F)
Dim brush As PdfBrush = PdfBrushes.Black
'Creates Date time field.
Dim dateTimeField As New PdfCreationDateField(font)
For i As Integer = 0 To 2
page = doc.Pages.Add()
dateTimeField.Draw(page.Graphics)
Next
'Save and close the document.
doc.Save("DateTimeField.pdf")
doc.Close(True)
PdfCreationDateField(PdfFont, PdfBrush)
Initializes a new instance of the PdfCreationDateField class with PdfFont and PdfBrush.
Declaration
public PdfCreationDateField(PdfFont font, PdfBrush brush)
Parameters
Type | Name | Description |
---|---|---|
PdfFont | font | A PdfFont object that specifies the font attributes (the family name, the size, and the style of the font) to use. |
PdfBrush | brush | A PdfBrush object that is used to fill the string. |
Examples
//Create a new document.
PdfDocument doc = new PdfDocument();
//Create a new page.
PdfPage page = doc.Pages.Add();
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
PdfBrush brush = PdfBrushes.Black;
//Creates Date time field.
PdfCreationDateField dateTimeField = new PdfCreationDateField(font,brush);
for (int i = 0; i!=3; i++)
{
page = doc.Pages.Add();
dateTimeField.Draw(page.Graphics);
}
//Save and close the document.
doc.Save("DateTimeField.pdf");
doc.Close(true);
'Create a new document.
Dim doc As New PdfDocument()
'Create a new page.
Dim page As PdfPage = doc.Pages.Add()
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12F)
Dim brush As PdfBrush = PdfBrushes.Black
'Creates Date time field.
Dim dateTimeField As New PdfCreationDateField(font,brush)
For i As Integer = 0 To 2
page = doc.Pages.Add()
dateTimeField.Draw(page.Graphics)
Next
'Save and close the document.
doc.Save("DateTimeField.pdf")
doc.Close(True)
PdfCreationDateField(PdfFont, RectangleF)
Initializes a new instance of the PdfCreationDateField class with PdfFont and System.Drawing.RectangleF.
Declaration
public PdfCreationDateField(PdfFont font, RectangleF bounds)
Parameters
Type | Name | Description |
---|---|---|
PdfFont | font | A PdfFontobject that specifies the font attributes (the family name, the size, and the style of the font) to use. |
System.Drawing.RectangleF | bounds | Specifies the location and size of the field. |
Examples
//Creates a new document.
PdfDocument doc = new PdfDocument();
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
//Creates Date time field.
PdfCreationDateField dateTimeField = new PdfCreationDateField(font, new RectangleF(new PointF(10,10), new SizeF(100,200)));
for (int i = 0; i !=3; i++)
{
//Creates a new page.
PdfPage page = doc.Pages.Add();
dateTimeField.Draw(page.Graphics);
}
//Save and close the document.
doc.Save("DateTimeField.pdf");
doc.Close(true);
'Creates a new document.
Dim doc As PdfDocument = New PdfDocument()
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f)
'Creates Date time field.
Dim dateTimeField As PdfCreationDateField = New PdfCreationDateField(font, New RectangleF(New PointF(10,10), New SizeF(100,200)))
For i As Integer = 0 To 2
'Create a new page.
Dim page As PdfPage = doc.Pages.Add()
dateTimeField.Draw(page.Graphics)
Next i
'Save and close the document.
doc.Save("DateTimeField.pdf")
doc.Close(True)
Properties
DateFormatString
Gets or sets the format string.
Declaration
public string DateFormatString { get; set; }
Property Value
Type | Description |
---|---|
System.String | The format string. |
Examples
//Creates a new document.
PdfDocument doc = new PdfDocument();
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
//Creates Date time field.
PdfCreationDateField dateTimeField = new PdfCreationDateField(font, new RectangleF(new PointF(10,10), new SizeF(100,200)));
dateTimeField.DateFormatString = "dd'/'MMMM'/'yyyy";
for (int i = 0; i != 3; i++)
{
//Creates a new page.
PdfPage page = doc.Pages.Add();
dateTimeField.Draw(page.Graphics);
}
//Save and close the document.
doc.Save("DateTimeField.pdf");
doc.Close(true);
'Creates a new document.
Dim doc As PdfDocument = New PdfDocument()
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f)
'Creates Date time field.
Dim dateTimeField As PdfCreationDateField = New PdfCreationDateField(font, New RectangleF(New PointF(10,10), New SizeF(100,200)))
dateTimeField.DateFormatString = "dd'/'MMMM'/'yyyy"
For i As Integer = 0 To 2
'Create a page.
Dim page As PdfPage = doc.Pages.Add()
dateTimeField.Draw(page.Graphics)
Next i
'Save and close the document.
doc.Save("DateTimeField.pdf")
doc.Close(True)