Class PdfXfaLinearType
Specifies the direction of the color transition.
Inheritance
System.Object
PdfXfaLinearType
Namespace: Syncfusion.Pdf.Xfa
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public sealed class PdfXfaLinearType : Enum
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()
Fields
BottomToTop
The start color appears at the bottom side of the object and transitions into the end color at the top side.
Declaration
public const PdfXfaLinearType BottomToTop
Field Value
Type |
---|
PdfXfaLinearType |
LeftToRight
The start color appears at the left side of the object and transitions into the end color at the right side.
Declaration
public const PdfXfaLinearType LeftToRight
Field Value
Type |
---|
PdfXfaLinearType |
RightToLeft
The start color appears at the right side of the object and transitions into the end color at the left side.
Declaration
public const PdfXfaLinearType RightToLeft
Field Value
Type |
---|
PdfXfaLinearType |
TopToBottom
The start color appears at the top side of the object and transitions into the end color at the bottom side.
Declaration
public const PdfXfaLinearType TopToBottom
Field Value
Type |
---|
PdfXfaLinearType |