Class PdfDocumentAuthorField
Represent automatic field which contains document's author name.
Inheritance
Inherited Members
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfDocumentAuthorField : PdfSingleValueField
Examples
// Create a new document
PdfDocument doc = new PdfDocument();
// Set the document`s information
doc.DocumentInformation.Author = "Syncfusion";
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
PdfBrush brush = PdfBrushes.Black;
PdfDocumentAuthorField documentAuthorField = new PdfDocumentAuthorField(font);
for (int i = 0; i!=2; i++)
{
PdfPage page = doc.Pages.Add();
documentAuthorField.Draw(page.Graphics);
}
doc.Save("DocumentAuthorField.pdf");
doc.Close(true);
' Create a new document
Dim doc As PdfDocument = New PdfDocument()
' Set the document`s information
doc.DocumentInformation.Author = "Syncfusion"
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f)
Dim brush As PdfBrush = PdfBrushes.Black
Dim documentAuthorField As PdfDocumentAuthorField = New PdfDocumentAuthorField(font)
For i As Integer = 0 To 1
Dim page As PdfPage = doc.Pages.Add()
documentAuthorField.Draw(page.Graphics)
Next i
doc.Save("DocumentAuthorField.pdf")
doc.Close(True)
Constructors
PdfDocumentAuthorField()
Initializes a new instance of the PdfDocumentAuthorField class.
Declaration
public PdfDocumentAuthorField()
Examples
// Create a new document
PdfDocument doc = new PdfDocument();
// Set the document`s information
doc.DocumentInformation.Author = "Syncfusion";
PdfDocumentAuthorField documentAuthorField = new PdfDocumentAuthorField();
for (int i = 0; i!=2; i++)
{
PdfPage page = doc.Pages.Add();
documentAuthorField.Draw(page.Graphics);
}
doc.Save("DocumentAuthorField.pdf");
doc.Close(true);
' Create a new document
Dim doc As PdfDocument = New PdfDocument()
' Set the document`s information
doc.DocumentInformation.Author = "Syncfusion"
Dim documentAuthorField As PdfDocumentAuthorField = New PdfDocumentAuthorField()
For i As Integer = 0 To 1
Dim page As PdfPage = doc.Pages.Add()
documentAuthorField.Draw(page.Graphics)
Next i
doc.Save("DocumentAuthorField.pdf")
doc.Close(True)
PdfDocumentAuthorField(PdfFont)
Initializes a new instance of the PdfDocumentAuthorField class with PdfFont
Declaration
public PdfDocumentAuthorField(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();
// Set the document`s information
doc.DocumentInformation.Author = "Syncfusion";
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
PdfBrush brush = PdfBrushes.Black;
PdfDocumentAuthorField documentAuthorField = new PdfDocumentAuthorField(font);
for (int i = 0; i!=2; i++)
{
PdfPage page = doc.Pages.Add();
documentAuthorField.Draw(page.Graphics);
}
doc.Save("DocumentAuthorField.pdf");
doc.Close(true);
' Create a new document
Dim doc As PdfDocument = New PdfDocument()
' Set the document`s information
doc.DocumentInformation.Author = "Syncfusion"
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f)
Dim brush As PdfBrush = PdfBrushes.Black
Dim documentAuthorField As PdfDocumentAuthorField = New PdfDocumentAuthorField(font)
For i As Integer = 0 To 1
Dim page As PdfPage = doc.Pages.Add()
documentAuthorField.Draw(page.Graphics)
Next i
doc.Save("DocumentAuthorField.pdf")
doc.Close(True)
PdfDocumentAuthorField(PdfFont, PdfBrush)
Initializes a new instance of the PdfDocumentAuthorField class with PdfFont and PdfBrush.
Declaration
public PdfDocumentAuthorField(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
// Creates a new document
PdfDocument doc = new PdfDocument();
// Set the document`s information
doc.DocumentInformation.Author = "Syncfusion";
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
PdfBrush brush = PdfBrushes.Black;
PdfDocumentAuthorField documentAuthorField = new PdfDocumentAuthorField(font, brush);
for (int i = 0; i != 2; i++)
{
PdfPage page = doc.Pages.Add();
documentAuthorField.Draw(page.Graphics);
}
doc.Save("DocumentAuthorField.pdf");
doc.Close(true);
' Creates a new document
Dim doc As PdfDocument = New PdfDocument()
' Set the document`s information
doc.DocumentInformation.Author = "Syncfusion"
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f)
Dim brush As PdfBrush = PdfBrushes.Black
Dim documentAuthorField As PdfDocumentAuthorField = New PdfDocumentAuthorField(font, brush)
For i As Integer = 0 To 1
Dim page As PdfPage = doc.Pages.Add()
documentAuthorField.Draw(page.Graphics)
Next i
doc.Save("DocumentAuthorField.pdf")
doc.Close(True)
PdfDocumentAuthorField(PdfFont, RectangleF)
Initializes a new instance of the PdfDocumentAuthorField class with PdfFont and rectangle bounds.
Declaration
public PdfDocumentAuthorField(PdfFont font, RectangleF bounds)
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. |
System.Drawing.RectangleF | bounds | The bounds. |
Examples
// Create a new document
PdfDocument doc = new PdfDocument();
// Set the document`s information
doc.DocumentInformation.Author = "Syncfusion";
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
PdfBrush brush = PdfBrushes.Black;
PdfDocumentAuthorField documentAuthorField = new PdfDocumentAuthorField(font, new RectangleF(0, 0, 100, 200));
for (int i = 0; i!= 2; i++)
{
PdfPage page = doc.Pages.Add();
documentAuthorField.Draw(page.Graphics);
}
doc.Save("DocumentAuthorField.pdf");
doc.Close(true);
' Create a new document
Dim doc As PdfDocument = New PdfDocument()
' Set the document`s information
doc.DocumentInformation.Author = "Syncfusion"
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f)
Dim brush As PdfBrush = PdfBrushes.Black
Dim documentAuthorField As PdfDocumentAuthorField = New PdfDocumentAuthorField(font, New RectangleF(0,0,100,200))
For i As Integer = 0 To 1
Dim page As PdfPage = doc.Pages.Add()
documentAuthorField.Draw(page.Graphics)
Next i
doc.Save("DocumentAuthorField.pdf")
doc.Close(True)