Returns the width of a slide in points.
class SlidesApp method .getPageWidth()
SlidesApp is the Apps Script service.
.getPageWidth() is the method name you will see after a dot in your code.
What it does
Why it's used
- Position shapes or images with correct proportions.
- Layout custom graphics that need to fit the slide.
Common errors
- Forgetting parentheses on getPageWidth. Write SlidesApp.getPageWidth(), not SlidesApp.getPageWidth or getPageWidth by itself.
- Skipping dots between chained calls. Each step needs a dot, like SlidesApp.getPageWidth().
- Adding spaces where they do not belong. Write SlidesApp.getPageWidth(), not SlidesApp .getPageWidth(), SlidesApp.getPageWidth (), or SlidesApp . getPageWidth().
- Wrong capitalization. Use SlidesApp and getPageWidth, not slidesapp or getpagewidth.
Explore
Related methods
-
.getPageHeight()
Returns the height of a slide in points.
-
.getSlides()
Returns every slide in the presentation.
-
.appendSlide()
Adds a new slide to the end of the presentation.
-
.getActivePresentation()
Returns the presentation the user currently has open.
-
.create()
Creates a new blank Google Slides presentation.
More Apps Script
Better Sheets tutorials
No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.
Related blog posts
Written guides about SlidesApp.getPageWidth().