Class PageBackground

PageBackground

Describes the page's background

Methods

MethodReturn typeBrief description
getPictureFill()PictureFillGet the stretched picture fill of this background, or null if the background fill type is not PageBackgroundType.PICTURE.
getSolidFill()SolidFillGet the solid fill of this background, or null if the background fill type is not PageBackgroundType.SOLID.
getType()PageBackgroundTypeGet the type of this page background.
isVisible()BooleanWhether the background is visible.
setPictureFill(blobSource)voidSets an image from the specified image blob as the page background.
setPictureFill(imageUrl)voidSets the image at the provided URL as the page background.
setSolidFill(color)voidSets the solid fill to the given Color.
setSolidFill(color, alpha)voidSets the solid fill to the given alpha and Color.
setSolidFill(red, green, blue)voidSets the solid fill to the given RGB values.
setSolidFill(red, green, blue, alpha)voidSets the solid fill to the given alpha and RGB values.
setSolidFill(hexString)voidSets the solid fill to the given hex color string.
setSolidFill(hexString, alpha)voidSets the solid fill to the given alpha and hex color string.
setSolidFill(color)voidSets the solid fill to the given ThemeColorType.
setSolidFill(color, alpha)voidSets the solid fill to the given alpha and ThemeColorType.
setTransparent()voidSets the background to transparent.

Detailed documentation

getPictureFill()

Get the stretched picture fill of this background, or null if the background fill type is not PageBackgroundType.PICTURE.

Return

PictureFill


getSolidFill()

Get the solid fill of this background, or null if the background fill type is not PageBackgroundType.SOLID.

Return

SolidFill


getType()

Get the type of this page background.

Return

PageBackgroundType


isVisible()

Whether the background is visible.

Return

Boolean


setPictureFill(blobSource)

Sets an image from the specified image blob as the page background. The image is stretched to match the dimensions of the page.

Inserting the image fetches it from the BlobSource once and a copy is stored for display inside the presentation. Images must be less than 50MB in size, cannot exceed 25 megapixels, and must be in either in PNG, JPEG, or GIF format.

Parameters

NameTypeDescription
blobSourceBlobSourceThe image data.

setPictureFill(imageUrl)

Sets the image at the provided URL as the page background. The image is stretched to match the dimensions of the page.

Inserting the image fetches it from the URL once and a copy is stored for display inside the presentation. Images must be less than 50MB in size, cannot exceed 25 megapixels, and must be in either in PNG, JPEG, or GIF format.

The provided URL must be no larger than 2kB.

Parameters

NameTypeDescription
imageUrlStringThe URL to download the image from.

setSolidFill(color)

Sets the solid fill to the given Color.

Parameters

NameTypeDescription
colorColor

setSolidFill(color, alpha)

Sets the solid fill to the given alpha and Color.

Parameters

NameTypeDescription
colorColor
alphaNumber

setSolidFill(red, green, blue)

Sets the solid fill to the given RGB values.

Parameters

NameTypeDescription
redInteger
greenInteger
blueInteger

setSolidFill(red, green, blue, alpha)

Sets the solid fill to the given alpha and RGB values.

Parameters

NameTypeDescription
redInteger
greenInteger
blueInteger
alphaNumber

setSolidFill(hexString)

Sets the solid fill to the given hex color string.

The hex string must be in the format '#RRGGBB'. For example, pink would be represented as '#FFC0CB'.

Parameters

NameTypeDescription
hexStringString

setSolidFill(hexString, alpha)

Sets the solid fill to the given alpha and hex color string.

The hex string must be in the format '#RRGGBB'. For example, pink would be represented as '#FFC0CB'.

Parameters

NameTypeDescription
hexStringString
alphaNumber

setSolidFill(color)

Sets the solid fill to the given ThemeColorType.

Parameters

NameTypeDescription
colorThemeColorType

setSolidFill(color, alpha)

Sets the solid fill to the given alpha and ThemeColorType.

Parameters

NameTypeDescription
colorThemeColorType
alphaNumber

setTransparent()

Sets the background to transparent.

发送以下问题的反馈:

此网页
Apps Script
Apps Script