PageSetup.ODSPageBackground

PageSetup.ODSPageBackground property

Gets the background of ODS.

public OdsPageBackground ODSPageBackground { get; }

Examples

using System;
using System.Drawing;
using Aspose.Cells;
using Aspose.Cells.Ods;

namespace AsposeCellsExamples
{
    public class PageSetupPropertyODSPageBackgroundDemo
    {
        public static void Run()
        {
            Workbook workbook = new Workbook();
            Worksheet sheet = workbook.Worksheets[0];
            
            OdsPageBackground background = sheet.PageSetup.ODSPageBackground;
            
            // Set color background
            background.Type = OdsPageBackgroundType.Color;
            background.Color = Color.LightGreen;
            
            // Alternatively, set graphic background
            background.Type = OdsPageBackgroundType.Graphic;
            background.GraphicType = OdsPageBackgroundGraphicType.Tile;
            background.GraphicPositionType = OdsPageBackgroundGraphicPositionType.TopLeft;
            
            workbook.Save("ODSPageBackgroundDemo.ods");
        }
    }
}

See Also