Class PdfDocumentAuthorField
- Namespace
- Syncfusion.Pdf
- Assembly
- Syncfusion.Pdf.Portable.dll
Represent automatic field which contains document's author name.
public class PdfDocumentAuthorField : PdfSingleValueField
- Inheritance
-
PdfDocumentAuthorField
- Inherited Members
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.
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)
- See Also
PdfDocumentAuthorField(PdfFont)
Initializes a new instance of the PdfDocumentAuthorField class with PdfFont
public PdfDocumentAuthorField(PdfFont font)
Parameters
font
PdfFontA 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)
- See Also
PdfDocumentAuthorField(PdfFont, RectangleF)
Initializes a new instance of the PdfDocumentAuthorField class with PdfFont and rectangle bounds.
public PdfDocumentAuthorField(PdfFont font, RectangleF bounds)
Parameters
font
PdfFontA PdfFont object that specifies the font attributes (the family name, the size, and the style of the font) to use.
bounds
RectangleFThe 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)
- See Also
PdfDocumentAuthorField(PdfFont, PdfBrush)
Initializes a new instance of the PdfDocumentAuthorField class with PdfFont and PdfBrush.
public PdfDocumentAuthorField(PdfFont font, PdfBrush brush)
Parameters
font
PdfFontA PdfFont object that specifies the font attributes (the family name, the size, and the style of the font) to use.
brush
PdfBrushA 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)
- See Also
Methods
GetValue(PdfGraphics)
Gets the value of the field at the specified graphics.
protected override string GetValue(PdfGraphics graphics)
Parameters
graphics
PdfGraphicsThe graphics.
Returns
- See Also