Class PdfXfaLinearBrush
- Namespace
- Syncfusion.Pdf.Xfa
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents the XFA linear brush
public class PdfXfaLinearBrush : PdfXfaBrush
- Inheritance
-
PdfXfaLinearBrush
- Inherited Members
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 PdfXfaLinearBrush(Color.Red, Color.Yellow);
//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();
'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 PdfXfaLinearBrush(Color.Red, Color.Yellow)
'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
PdfXfaLinearBrush(PdfColor, PdfColor)
iniatilaize the new instance of the PdfXfaLinearBrush class.
public PdfXfaLinearBrush(PdfColor startColor, PdfColor endColor)
Parameters
startColor
PdfColorThe start color of the linear brush.
endColor
PdfColorThe end color of the linear 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 PdfXfaLinearBrush(Color.Red, Color.Yellow);
//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();
'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 PdfXfaLinearBrush(Color.Red, Color.Yellow)
'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()
PdfXfaLinearBrush(PdfColor, PdfColor, PdfXfaLinearType)
iniatilaize the new instance of the PdfXfaLinearBrush class.
public PdfXfaLinearBrush(PdfColor startColor, PdfColor endColor, PdfXfaLinearType type)
Parameters
startColor
PdfColorThe start color of the linear brush.
endColor
PdfColorThe end color of the linear brush.
type
PdfXfaLinearTypeThe type of the linar 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 PdfXfaLinearBrush(Color.Red, Color.Yellow, PdfXfaLinearType.RightToLeft);
//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();
'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 PdfXfaLinearBrush(Color.Red, Color.Yellow, PdfXfaLinearType.RightToLeft)
'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
EndColor
Gets or sets the ending color
public PdfColor EndColor { get; set; }
Property Value
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.
PdfXfaLinearBrush brush = new PdfXfaLinearBrush(Color.Red, Color.Yellow);
//Set the start color.
brush.StartColor = Color.Black;
//Set the end color.
brush.EndColor = Color.HotPink;
//Set the type.
brush.Type = PdfXfaLinearType.RightToLeft;
//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();
'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 PdfXfaLinearBrush = New PdfXfaLinearBrush(Color.Red, Color.Yellow)
'Set the start color.
brush.StartColor = Color.Black
'Set the end color.
brush.EndColor = Color.HotPink
'Set the type.
brush.Type = PdfXfaLinearType.RightToLeft
'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()
StartColor
Gets or sets the starting color
public PdfColor StartColor { get; set; }
Property Value
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.
PdfXfaLinearBrush brush = new PdfXfaLinearBrush(Color.Red, Color.Yellow);
//Set the start color.
brush.StartColor = Color.Black;
//Set the end color.
brush.EndColor = Color.HotPink;
//Set the type.
brush.Type = PdfXfaLinearType.RightToLeft;
//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();
'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 PdfXfaLinearBrush = New PdfXfaLinearBrush(Color.Red, Color.Yellow)
'Set the start color.
brush.StartColor = Color.Black
'Set the end color.
brush.EndColor = Color.HotPink
'Set the type.
brush.Type = PdfXfaLinearType.RightToLeft
'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()
Type
Gets or sets the direction of the color transition
public PdfXfaLinearType Type { get; set; }
Property Value
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.
PdfXfaLinearBrush brush = new PdfXfaLinearBrush(Color.Red, Color.Yellow);
//Set the start color.
brush.StartColor = Color.Black;
//Set the end color.
brush.EndColor = Color.HotPink;
//Set the type.
brush.Type = PdfXfaLinearType.RightToLeft;
//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();
'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 PdfXfaLinearBrush = New PdfXfaLinearBrush(Color.Red, Color.Yellow)
'Set the start color.
brush.StartColor = Color.Black
'Set the end color.
brush.EndColor = Color.HotPink
'Set the type.
brush.Type = PdfXfaLinearType.RightToLeft
'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()