Search code examples
javagoogle-apps-scriptgoogle-slides-apigoogle-slides

Google Slides API: Increase Page Size in Create Presentation


How do I increase the size of a page in Google Slides? Right now the page size is confined to Widescreen 16:9. The following is not working in Java, is this a bug perhaps with Google Slides API? It doesn't seem to recognize Page Size Properties

String titleSlide = "SlideTest";
Dimension ptHeight = new Dimension().setMagnitude(12000.0).setUnit("PT");
Dimension ptWidth= new Dimension().setMagnitude(12000.0).setUnit("PT");

Presentation presentation = new Presentation()
                                .setPageSize(new Size()
                                    .setHeight(ptHeight)
                                    .setWidth(ptWidth))
                                .setTitle(titleSlide);

presentation = service.presentations()
        .create(presentation)
        .setFields("presentationId")
        .execute();

Google Slides Page Image

Resources:

Google Slide API CreateSlideRequest

Google Slide API PageElementProperties


Solution

  • There seems to be an issue with the pageSize not affecting the size of the pages in the presentation. This was reported in Google's Issue Tracker here: https://issuetracker.google.com/issues/119321089

    Add a "star" next to the issue number to indicate you are affected by it.