Enum OdsPageBackgroundType

OdsPageBackgroundType enumeration

Represents the page background type of ods.

public enum OdsPageBackgroundType

Values

NameValueDescription
None0No background.
Color1Formats the background with color.
Graphic2Formats the background with image.

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using Aspose.Cells.Ods;
    using System;
    using System.Drawing;

    public class OdsPageBackgroundTypeDemo
    {
        public static void OdsPageBackgroundTypeExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();

            // Add a new worksheet to the workbook
            Worksheet worksheet = workbook.Worksheets[0];

            // Access the PageSetup of the worksheet
            PageSetup pageSetup = worksheet.PageSetup;

            // Access the ODSPageBackground property
            OdsPageBackground odsPageBackground = pageSetup.ODSPageBackground;

            // Set the background type to Color
            odsPageBackground.Type = OdsPageBackgroundType.Color;

            // Set the background color
            odsPageBackground.Color = Color.LightBlue;

            // Save the workbook
            workbook.Save("OdsPageBackgroundTypeExample.ods");
        }
    }
}

See Also