Working with Background in ODS Files

Background in ODS Files

Background can be added to sheets in ODS files. The background can either be a colored background or graphic background. The background is not visible when the file is open but if the file is printed as PDF, the background is visible in the generated PDF. The background is also visible in the print preview dialogue.

Aspose.Cells provides the ability to read the background information and add the background in ODS files.

Read Background Information from ODS file

Aspose.Cells provides the OdsPageBackground class to manage background in ODS Files. The following code sample demonstrates the use of OdsPageBackground class by loading the source ODS file and reading the background information. Please see the Console Output generated by the code for reference.

Sample Code

Console Output

Background Type: Graphic

Backgorund Position: CenterCenter

Add Colored Background to ODS file

Aspose.Cells provides the OdsPageBackground class to manage background in ODS Files. The following code sample demonstrates the use of OdsPageBackground.Color property to add a color background to the ODS file. Please see the output ODS file generated by the code for reference.

Sample Code

Add Graphic Background to ODS file

Aspose.Cells provides the OdsPageBackground class to manage background in ODS Files. The following code sample demonstrates the use of OdsPageBackground.GraphicData property to add graphic background to the ODS file. Please see the output ODS file generated by the code for reference.

Sample Code