Class Background
Represents the background effects.
Implements
Inherited Members
Namespace: Syncfusion.DocIO.DLS
Assembly: Syncfusion.DocIO.Portable.dll
Syntax
public class Background : XDLSSerializableBase, IXDLSSerializable
Properties
Color
Gets or sets the background color of the document.
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
Color | The System.Drawing.Color specifies the background color for this document. |
Examples
private void Button1_Click(System.Object sender, System.EventArgs e)
{
//Load an existing Word document into WordDocument instance
WordDocument document = new WordDocument("Sample.docx");
//Set the background type of the document
document.Background.Type = BackgroundType.Color;
//Set the background color of the document
document.Background.Color = Color.AliceBlue;
//Save the document in the given name and format
document.Save("Document.docx", FormatType.Docx);
//Release the resources occupied by WordDocument instance
document.Close();
}
Private Sub button_Click(sender As Object, e As EventArgs)
'Load an existing Word document into WordDocument instance
Dim document As New WordDocument("Sample.docx")
'Set the background type of the document
document.Background.Type = BackgroundType.Color
'Set the background color of the document
document.Background.Color = Color.AliceBlue
'Save the document in the given name and format
document.Save("Document.docx", FormatType.Docx)
'Release the resources occupied by WordDocument instance
document.Close()
End Sub
Gradient
Gets or sets the background gradient.
Declaration
public BackgroundGradient Gradient { get; set; }
Property Value
Type | Description |
---|---|
BackgroundGradient | The BackgroundGradient object that specifies the gradient effect. |
See Also
Picture
Gets or sets the background picture.
Declaration
public byte[] Picture { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] | The byte array contains the picture data that represents the background for the document. |
Type
Gets or sets the type of background effect.
Declaration
public BackgroundType Type { get; set; }
Property Value
Type | Description |
---|---|
BackgroundType | The BackgroundType member that specifies the type of background. |
Methods
InitXDLSHolder()
Registers child objects in XDSL holder.
Declaration
protected override void InitXDLSHolder()
Overrides
ReadXmlAttributes(IXDLSAttributeReader)
Reads object data from xml attributes.
Declaration
protected override void ReadXmlAttributes(IXDLSAttributeReader reader)
Parameters
Type | Name | Description |
---|---|---|
IXDLSAttributeReader | reader | The IXDLSAttributeReader object. |
Overrides
ReadXmlContent(IXDLSContentReader)
Reads object data from xml attributes.
Declaration
protected override bool ReadXmlContent(IXDLSContentReader reader)
Parameters
Type | Name | Description |
---|---|---|
IXDLSContentReader | reader | The IXDLSContentReader object. |
Returns
Type | Description |
---|---|
System.Boolean | The value indicating the presence of xml content. |
Overrides
WriteXmlAttributes(IXDLSAttributeWriter)
Writes object data as xml attributes.
Declaration
protected override void WriteXmlAttributes(IXDLSAttributeWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IXDLSAttributeWriter | writer | The IXDLSAttributeWriter object. |
Overrides
WriteXmlContent(IXDLSContentWriter)
Writes object data as inside xml element.
Declaration
protected override void WriteXmlContent(IXDLSContentWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IXDLSContentWriter | writer | The IXDLSContentWriter object. |