Class PdfXfaSolidBrush
Represents the XFA solid brush.
Namespace: Syncfusion.Pdf.Xfa
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class PdfXfaSolidBrush : PdfXfaBrush
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Create a form.
PdfXfaForm parentForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
parentForm.Margins.All = 10;
//Create new XFA rectangle instance.
PdfXfaRectangleField rect = new PdfXfaRectangleField("rect1", new SizeF(200, 100));
//Create new XFA brush.
PdfXfaBrush brush = new PdfXfaSolidBrush(Color.Red);
//Set the brush
rect.Border.FillColor = brush;
//Add the field to form.
parentForm.Fields.Add(rect);
document.XfaForm = parentForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim parentForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
parentForm.Margins.All = 10
'Create new XFA rectangle instance.
Dim rect As New PdfXfaRectangleField("rect1", New SizeF(200, 100))
'Create new XFA brush.
Dim brush As PdfXfaBrush = New PdfXfaSolidBrush(Color.Red)
'Set the linear brush
rect.Border.FillColor = brush
'Add the field to form.
parentForm.Fields.Add(rect)
document.XfaForm = parentForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Constructors
PdfXfaSolidBrush(PdfColor)
Initialize the instaces of the PdfXfaSolidBrush class.
Declaration
public PdfXfaSolidBrush(PdfColor color)
Parameters
Type | Name | Description |
---|---|---|
PdfColor | color | The fill color of the brush. |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Create a form.
PdfXfaForm parentForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
parentForm.Margins.All = 10;
//Create new XFA rectangle instance.
PdfXfaRectangleField rect = new PdfXfaRectangleField("rect1", new SizeF(200, 100));
//Create new XFA brush.
PdfXfaBrush brush = new PdfXfaSolidBrush(Color.Red);
//Set the brush
rect.Border.FillColor = brush;
//Add the field to form.
parentForm.Fields.Add(rect);
document.XfaForm = parentForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim parentForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
parentForm.Margins.All = 10
'Create new XFA rectangle instance.
Dim rect As New PdfXfaRectangleField("rect1", New SizeF(200, 100))
'Create new XFA brush.
Dim brush As PdfXfaBrush = New PdfXfaSolidBrush(Color.Red)
'Set the linear brush
rect.Border.FillColor = brush
'Add the field to form.
parentForm.Fields.Add(rect)
document.XfaForm = parentForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Properties
Color
Gets or sets the solid brush color
Declaration
public PdfColor Color { get; set; }
Property Value
Type |
---|
PdfColor |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Create a form.
PdfXfaForm parentForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
parentForm.Margins.All = 10;
//Create new XFA rectangle instance.
PdfXfaRectangleField rect = new PdfXfaRectangleField("rect1", new SizeF(200, 100));
//Create new XFA brush.
PdfXfaSolidBrush brush= new PdfXfaSolidBrush(Color.Red);
//Set the color.
brush.Color = Color.Green;
//Set the brush
rect.Border.FillColor = brush;
//Add the field to form.
parentForm.Fields.Add(rect);
document.XfaForm = parentForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim parentForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
parentForm.Margins.All = 10
'Create new XFA rectangle instance.
Dim rect As New PdfXfaRectangleField("rect1", New SizeF(200, 100))
'Create new XFA brush.
Dim brush As PdfXfaSolidBrush = New PdfXfaSolidBrush(Color.Red)
'Set the color.
brush.Color = Color.Green
'Set the linear brush
rect.Border.FillColor = brush
'Add the field to form.
parentForm.Fields.Add(rect)
document.XfaForm = parentForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()