إدراج صورة خلفية إلى إكسل

تعيين خلفية الورقة في Microsoft Excel

لتعيين صورة خلفية لورقة في Microsoft Excel (على سبيل المثال، Microsoft Excel 2019):

  1. من القائمة تخطيط الصفحة، ابحث عن خيار إعداد الصفحة، ثم انقر فوق خيار الخلفية.
  2. حدد صورة لتعيين صورة خلفية للورقة.

تعيين خلفية الورقة باستخدام Aspose.Cells

يقوم الكود أدناه بتعيين صورة خلفية باستخدام صورة من مصدر بيانات.

import jpype
import asposecells
jpype.startJVM()
from asposecells.api import Workbook
# Create a new Workbook.
workbook = Workbook()
# Get the first worksheet.
worksheet = workbook.getWorksheets().get(0)
# Get the background picture.
with open('Background.jpg', 'rb') as f:
data = f.read()
# Set the background image for the sheet.
worksheet.setBackgroundImage(data)
# Save the excel file
workbook.save("output.xlsx")
jpype.shutdownJVM()