Insertar imagen de fondo en Excel
Cómo establecer el fondo de la hoja en Microsoft Excel
Para establecer una imagen de fondo de hoja en Microsoft Excel (por ejemplo, Microsoft Excel 2019):
-
Desde el menú Diseño de página, encontrar la opción Configurar página, y luego hacer clic en la opción Fondo.
-
Seleccionar una imagen para establecer la imagen de fondo de la hoja.
Establecer un fondo de hoja
Cómo establecer el fondo de la hoja con Aspose.Cells para la biblioteca de Excel en Python
El código a continuación establece una imagen de fondo utilizando una imagen de un flujo.
from aspose.cells import SaveFormat, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# Create a new Workbook. | |
workbook = Workbook() | |
# Get the first worksheet. | |
sheet = workbook.worksheets[0] | |
# Set the background image for the worksheet. | |
sheet.background_image = open("background.jpg", "rb").read() | |
# Save the Excel file | |
workbook.save("outputBackImageSheet.xlsx") | |
# Save the HTML file | |
workbook.save("outputBackImageSheet.html", SaveFormat.HTML) |