Class PageBackground Stay organized with collections Save and categorize content based on your preferences.
Page Summary
You can retrieve the picture or solid fill of a page background using
getPictureFill()orgetSolidFill(), which returnnullif the background type doesn't match.The type of the page background can be obtained with the
getType()method.You can check if the page background is visible using the
isVisible()method.Page backgrounds can be set to a picture from a blob source or a URL using the
setPictureFill()methods.Solid color backgrounds can be set using
setSolidFill()with various color representations, including Color objects, RGB values, hex strings, or ThemeColorType, with optional alpha transparency.The page background can be set to transparent using the
setTransparent()method.
Describes the page's background
Methods
| Method | Return type | Brief description |
|---|---|---|
get | Picture | Get the stretched picture fill of this background, ornull if the background fill typeis notPage. |
get | Solid | Get the solid fill of this background, ornull if the background fill type is notPage. |
get | Page | Get the type of this page background. |
is | Boolean | Whether the background is visible. |
set | void | Sets an image from the specified image blob as the page background. |
set | void | Sets the image at the provided URL as the page background. |
set | void | Sets the solid fill to the givenColor. |
set | void | Sets the solid fill to the given alpha andColor. |
set | void | Sets the solid fill to the given RGB values. |
set | void | Sets the solid fill to the given alpha and RGB values. |
set | void | Sets the solid fill to the given hex color string. |
set | void | Sets the solid fill to the given alpha and hex color string. |
set | void | Sets the solid fill to the givenTheme. |
set | void | Sets the solid fill to the given alpha andTheme. |
set | void | Sets the background to transparent. |
Detailed documentation
getPictureFill()
Get the stretched picture fill of this background, ornull if the background fill typeis notPage.
Return
Picture
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
getSolidFill()
Get the solid fill of this background, ornull if the background fill type is notPage.
Return
Solid
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
getType()
Get the type of this page background.
Return
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
isVisible()
Whether the background is visible.
Return
Boolean
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setPictureFill(blobSource)
Sets an image from the specified image blob as the page background. The image is stretched tomatch the dimensions of the page.
Inserting the image fetches it from theBlob once and a copy is stored fordisplay inside the presentation. Images must be less than 50MB in size, cannot exceed 25megapixels, and must be in either in PNG, JPEG, or GIF format.
Parameters
| Name | Type | Description |
|---|---|---|
blob | Blob | The image data. |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setPictureFill(imageUrl)
Sets the image at the provided URL as the page background. The image is stretched to match thedimensions of the page.
Inserting the image fetches it from the URL once and a copy is stored for display inside thepresentation. Images must be less than 50MB in size, cannot exceed 25 megapixels, and must bein either in PNG, JPEG, or GIF format.
The provided URL must be publicly accessible and no larger than 2kB. The URL itself is savedwith the image and exposed viaPicture.
Parameters
| Name | Type | Description |
|---|---|---|
image | String | The URL to download the image from. |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setSolidFill(color)
setSolidFill(color, alpha)
Sets the solid fill to the given alpha andColor.
Parameters
| Name | Type | Description |
|---|---|---|
color | Color | |
alpha | Number |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setSolidFill(red, green, blue)
Sets the solid fill to the given RGB values.
Parameters
| Name | Type | Description |
|---|---|---|
red | Integer | |
green | Integer | |
blue | Integer |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setSolidFill(red, green, blue, alpha)
Sets the solid fill to the given alpha and RGB values.
Parameters
| Name | Type | Description |
|---|---|---|
red | Integer | |
green | Integer | |
blue | Integer | |
alpha | Number |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setSolidFill(hexString)
Sets the solid fill to the given hex color string.
The hex string must be in the format '#RRGGBB'. For example, pink is represented as'#FFC0CB'.
Parameters
| Name | Type | Description |
|---|---|---|
hex | String |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
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 is represented as'#FFC0CB'.
Parameters
| Name | Type | Description |
|---|---|---|
hex | String | |
alpha | Number |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setSolidFill(color)
Sets the solid fill to the givenTheme.
Parameters
| Name | Type | Description |
|---|---|---|
color | Theme |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setSolidFill(color, alpha)
Sets the solid fill to the given alpha andTheme.
Parameters
| Name | Type | Description |
|---|---|---|
color | Theme | |
alpha | Number |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setTransparent()
Sets the background to transparent.
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-11 UTC.