Table of Contents

Class PdfCreationDateField

Namespace
Syncfusion.Pdf
Assembly
Syncfusion.Pdf.Portable.dll

Represents class to display creation date of the document.

public class PdfCreationDateField : PdfSingleValueField
Inheritance
PdfCreationDateField
Inherited Members

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.

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)
See Also

PdfCreationDateField(PdfFont)

Initializes a new instance of the PdfCreationDateField class with PdfFont

public PdfCreationDateField(PdfFont font)

Parameters

font PdfFont

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)
See Also

PdfCreationDateField(PdfFont, RectangleF)

Initializes a new instance of the PdfCreationDateField class with PdfFont and Syncfusion.Drawing.RectangleF.

public PdfCreationDateField(PdfFont font, RectangleF bounds)

Parameters

font PdfFont

A PdfFontobject that specifies the font attributes (the family name, the size, and the style of the font) to use.

bounds RectangleF

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)
See Also

PdfCreationDateField(PdfFont, PdfBrush)

Initializes a new instance of the PdfCreationDateField class with PdfFont and PdfBrush.

public PdfCreationDateField(PdfFont font, PdfBrush brush)

Parameters

font PdfFont

A PdfFont object that specifies the font attributes (the family name, the size, and the style of the font) to use.

brush PdfBrush

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)
See Also

Properties

DateFormatString

Gets or sets the format string.

public string DateFormatString { get; set; }

Property Value

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)
See Also

Methods

GetValue(PdfGraphics)

Gets the value of the field at the specified graphics.

protected override string GetValue(PdfGraphics graphics)

Parameters

graphics PdfGraphics

The graphics.

Returns

string
See Also

See Also