Arrange and rezise all images in Google Slides











up vote
0
down vote

favorite












I'm making a presentation with only images and captions from events as a slideshow, one slide per event. One slide can contain 2-8 images from the same event.



I would like to be able to rezise and arrange all images in one slide or the whole presentation. But I can't figure out how to find or select all images.



I know how to insert a shape of a certain size, but I don't know how to find the images already inserted, and resize them.



function plassering() {
var slide = SlidesApp.getActivePresentation().getSlides()[6];
var shape = slide.insertShape(SlidesApp.ShapeType.RECTANGLE);
shape.setLeft(14).setTop(14).setWidth(690).setHeight(510).setRotation(0);
Logger.log('Left: ' + shape.getLeft()
+ 'pt; Top: ' + shape.getTop()
+ 'pt; Width: ' + shape.getWidth()
+ 'pt; Height: ' + shape.getHeight()
+ 'pt; Rotation: ' + shape.getRotation() + 'u00B0.');
}


The caption should be on top av all the images.










share|improve this question
























  • Can I ask you about your question? You want to resize the existing image on the slide. Is my understanding correct? When you can know the method for resizing one image, can you do this for all images? By the way, what is the meaning of The caption should be on top av all the images.? I'm sorry for my poor English skill.
    – Tanaike
    Nov 19 at 22:44












  • Yes, you understood correct. I need to know two things: 1. How to rezise and rearrange an existing object. 2. How to loop through all the images in a slide, and resize and reaarange them.
    – Ingeborg
    2 days ago










  • The caption is a text box with a description of the event.
    – Ingeborg
    2 days ago










  • Thank you for replying. Can I ask you about the rearrangement you think? For example, when each image is converted to the small size by 50 %, the spaces between each image become large. In this case, you want to also convert the spaces to 50 %. Is my understanding correct? And also, in order to help to understand your situation, can you provide a sample slides you want to use for this situation? Of course, please remove your personal information.
    – Tanaike
    2 days ago










  • Here is a test: docs.google.com/presentation/d/… All images should be the width of the slide, stacked on top of each other.
    – Ingeborg
    2 days ago















up vote
0
down vote

favorite












I'm making a presentation with only images and captions from events as a slideshow, one slide per event. One slide can contain 2-8 images from the same event.



I would like to be able to rezise and arrange all images in one slide or the whole presentation. But I can't figure out how to find or select all images.



I know how to insert a shape of a certain size, but I don't know how to find the images already inserted, and resize them.



function plassering() {
var slide = SlidesApp.getActivePresentation().getSlides()[6];
var shape = slide.insertShape(SlidesApp.ShapeType.RECTANGLE);
shape.setLeft(14).setTop(14).setWidth(690).setHeight(510).setRotation(0);
Logger.log('Left: ' + shape.getLeft()
+ 'pt; Top: ' + shape.getTop()
+ 'pt; Width: ' + shape.getWidth()
+ 'pt; Height: ' + shape.getHeight()
+ 'pt; Rotation: ' + shape.getRotation() + 'u00B0.');
}


The caption should be on top av all the images.










share|improve this question
























  • Can I ask you about your question? You want to resize the existing image on the slide. Is my understanding correct? When you can know the method for resizing one image, can you do this for all images? By the way, what is the meaning of The caption should be on top av all the images.? I'm sorry for my poor English skill.
    – Tanaike
    Nov 19 at 22:44












  • Yes, you understood correct. I need to know two things: 1. How to rezise and rearrange an existing object. 2. How to loop through all the images in a slide, and resize and reaarange them.
    – Ingeborg
    2 days ago










  • The caption is a text box with a description of the event.
    – Ingeborg
    2 days ago










  • Thank you for replying. Can I ask you about the rearrangement you think? For example, when each image is converted to the small size by 50 %, the spaces between each image become large. In this case, you want to also convert the spaces to 50 %. Is my understanding correct? And also, in order to help to understand your situation, can you provide a sample slides you want to use for this situation? Of course, please remove your personal information.
    – Tanaike
    2 days ago










  • Here is a test: docs.google.com/presentation/d/… All images should be the width of the slide, stacked on top of each other.
    – Ingeborg
    2 days ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm making a presentation with only images and captions from events as a slideshow, one slide per event. One slide can contain 2-8 images from the same event.



I would like to be able to rezise and arrange all images in one slide or the whole presentation. But I can't figure out how to find or select all images.



I know how to insert a shape of a certain size, but I don't know how to find the images already inserted, and resize them.



function plassering() {
var slide = SlidesApp.getActivePresentation().getSlides()[6];
var shape = slide.insertShape(SlidesApp.ShapeType.RECTANGLE);
shape.setLeft(14).setTop(14).setWidth(690).setHeight(510).setRotation(0);
Logger.log('Left: ' + shape.getLeft()
+ 'pt; Top: ' + shape.getTop()
+ 'pt; Width: ' + shape.getWidth()
+ 'pt; Height: ' + shape.getHeight()
+ 'pt; Rotation: ' + shape.getRotation() + 'u00B0.');
}


The caption should be on top av all the images.










share|improve this question















I'm making a presentation with only images and captions from events as a slideshow, one slide per event. One slide can contain 2-8 images from the same event.



I would like to be able to rezise and arrange all images in one slide or the whole presentation. But I can't figure out how to find or select all images.



I know how to insert a shape of a certain size, but I don't know how to find the images already inserted, and resize them.



function plassering() {
var slide = SlidesApp.getActivePresentation().getSlides()[6];
var shape = slide.insertShape(SlidesApp.ShapeType.RECTANGLE);
shape.setLeft(14).setTop(14).setWidth(690).setHeight(510).setRotation(0);
Logger.log('Left: ' + shape.getLeft()
+ 'pt; Top: ' + shape.getTop()
+ 'pt; Width: ' + shape.getWidth()
+ 'pt; Height: ' + shape.getHeight()
+ 'pt; Rotation: ' + shape.getRotation() + 'u00B0.');
}


The caption should be on top av all the images.







google-apps-script google-slides-api google-slides






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago









Tanaike

18.5k2921




18.5k2921










asked Nov 19 at 11:16









Ingeborg

527




527












  • Can I ask you about your question? You want to resize the existing image on the slide. Is my understanding correct? When you can know the method for resizing one image, can you do this for all images? By the way, what is the meaning of The caption should be on top av all the images.? I'm sorry for my poor English skill.
    – Tanaike
    Nov 19 at 22:44












  • Yes, you understood correct. I need to know two things: 1. How to rezise and rearrange an existing object. 2. How to loop through all the images in a slide, and resize and reaarange them.
    – Ingeborg
    2 days ago










  • The caption is a text box with a description of the event.
    – Ingeborg
    2 days ago










  • Thank you for replying. Can I ask you about the rearrangement you think? For example, when each image is converted to the small size by 50 %, the spaces between each image become large. In this case, you want to also convert the spaces to 50 %. Is my understanding correct? And also, in order to help to understand your situation, can you provide a sample slides you want to use for this situation? Of course, please remove your personal information.
    – Tanaike
    2 days ago










  • Here is a test: docs.google.com/presentation/d/… All images should be the width of the slide, stacked on top of each other.
    – Ingeborg
    2 days ago


















  • Can I ask you about your question? You want to resize the existing image on the slide. Is my understanding correct? When you can know the method for resizing one image, can you do this for all images? By the way, what is the meaning of The caption should be on top av all the images.? I'm sorry for my poor English skill.
    – Tanaike
    Nov 19 at 22:44












  • Yes, you understood correct. I need to know two things: 1. How to rezise and rearrange an existing object. 2. How to loop through all the images in a slide, and resize and reaarange them.
    – Ingeborg
    2 days ago










  • The caption is a text box with a description of the event.
    – Ingeborg
    2 days ago










  • Thank you for replying. Can I ask you about the rearrangement you think? For example, when each image is converted to the small size by 50 %, the spaces between each image become large. In this case, you want to also convert the spaces to 50 %. Is my understanding correct? And also, in order to help to understand your situation, can you provide a sample slides you want to use for this situation? Of course, please remove your personal information.
    – Tanaike
    2 days ago










  • Here is a test: docs.google.com/presentation/d/… All images should be the width of the slide, stacked on top of each other.
    – Ingeborg
    2 days ago
















Can I ask you about your question? You want to resize the existing image on the slide. Is my understanding correct? When you can know the method for resizing one image, can you do this for all images? By the way, what is the meaning of The caption should be on top av all the images.? I'm sorry for my poor English skill.
– Tanaike
Nov 19 at 22:44






Can I ask you about your question? You want to resize the existing image on the slide. Is my understanding correct? When you can know the method for resizing one image, can you do this for all images? By the way, what is the meaning of The caption should be on top av all the images.? I'm sorry for my poor English skill.
– Tanaike
Nov 19 at 22:44














Yes, you understood correct. I need to know two things: 1. How to rezise and rearrange an existing object. 2. How to loop through all the images in a slide, and resize and reaarange them.
– Ingeborg
2 days ago




Yes, you understood correct. I need to know two things: 1. How to rezise and rearrange an existing object. 2. How to loop through all the images in a slide, and resize and reaarange them.
– Ingeborg
2 days ago












The caption is a text box with a description of the event.
– Ingeborg
2 days ago




The caption is a text box with a description of the event.
– Ingeborg
2 days ago












Thank you for replying. Can I ask you about the rearrangement you think? For example, when each image is converted to the small size by 50 %, the spaces between each image become large. In this case, you want to also convert the spaces to 50 %. Is my understanding correct? And also, in order to help to understand your situation, can you provide a sample slides you want to use for this situation? Of course, please remove your personal information.
– Tanaike
2 days ago




Thank you for replying. Can I ask you about the rearrangement you think? For example, when each image is converted to the small size by 50 %, the spaces between each image become large. In this case, you want to also convert the spaces to 50 %. Is my understanding correct? And also, in order to help to understand your situation, can you provide a sample slides you want to use for this situation? Of course, please remove your personal information.
– Tanaike
2 days ago












Here is a test: docs.google.com/presentation/d/… All images should be the width of the slide, stacked on top of each other.
– Ingeborg
2 days ago




Here is a test: docs.google.com/presentation/d/… All images should be the width of the slide, stacked on top of each other.
– Ingeborg
2 days ago












1 Answer
1






active

oldest

votes

















up vote
0
down vote













I got it! This is for the current slide, but I guess I may do the same for all the slides, one at a time.



function rearrangeImages() {
//Select current page
var currentPage = SlidesApp.getActivePresentation().getSelection().getCurrentPage();
var slide = currentPage;
//Get all the images of CurrentPage
var pageElements = slide.getImages();
//For each image, change the size and position
for (var i = 0; i < pageElements.length; i++) {
pageElements[i].select(true);
var image = pageElements[i];
var imgWidth = image.getWidth();
var newWidth = 690;
var imgHeight = image.getHeight();
var forhold = imgHeight/imgWidth;
var newHeight = forhold*newWidth;
image.setLeft(14).setTop(14).setWidth(newWidth).setHeight(newHeight).setRotation(0);
var ui = SlidesApp.getUi();
// ui.alert (imgWidth);
pageElements[i].select(false);
}
}





share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53373460%2farrange-and-rezise-all-images-in-google-slides%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I got it! This is for the current slide, but I guess I may do the same for all the slides, one at a time.



    function rearrangeImages() {
    //Select current page
    var currentPage = SlidesApp.getActivePresentation().getSelection().getCurrentPage();
    var slide = currentPage;
    //Get all the images of CurrentPage
    var pageElements = slide.getImages();
    //For each image, change the size and position
    for (var i = 0; i < pageElements.length; i++) {
    pageElements[i].select(true);
    var image = pageElements[i];
    var imgWidth = image.getWidth();
    var newWidth = 690;
    var imgHeight = image.getHeight();
    var forhold = imgHeight/imgWidth;
    var newHeight = forhold*newWidth;
    image.setLeft(14).setTop(14).setWidth(newWidth).setHeight(newHeight).setRotation(0);
    var ui = SlidesApp.getUi();
    // ui.alert (imgWidth);
    pageElements[i].select(false);
    }
    }





    share|improve this answer

























      up vote
      0
      down vote













      I got it! This is for the current slide, but I guess I may do the same for all the slides, one at a time.



      function rearrangeImages() {
      //Select current page
      var currentPage = SlidesApp.getActivePresentation().getSelection().getCurrentPage();
      var slide = currentPage;
      //Get all the images of CurrentPage
      var pageElements = slide.getImages();
      //For each image, change the size and position
      for (var i = 0; i < pageElements.length; i++) {
      pageElements[i].select(true);
      var image = pageElements[i];
      var imgWidth = image.getWidth();
      var newWidth = 690;
      var imgHeight = image.getHeight();
      var forhold = imgHeight/imgWidth;
      var newHeight = forhold*newWidth;
      image.setLeft(14).setTop(14).setWidth(newWidth).setHeight(newHeight).setRotation(0);
      var ui = SlidesApp.getUi();
      // ui.alert (imgWidth);
      pageElements[i].select(false);
      }
      }





      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        I got it! This is for the current slide, but I guess I may do the same for all the slides, one at a time.



        function rearrangeImages() {
        //Select current page
        var currentPage = SlidesApp.getActivePresentation().getSelection().getCurrentPage();
        var slide = currentPage;
        //Get all the images of CurrentPage
        var pageElements = slide.getImages();
        //For each image, change the size and position
        for (var i = 0; i < pageElements.length; i++) {
        pageElements[i].select(true);
        var image = pageElements[i];
        var imgWidth = image.getWidth();
        var newWidth = 690;
        var imgHeight = image.getHeight();
        var forhold = imgHeight/imgWidth;
        var newHeight = forhold*newWidth;
        image.setLeft(14).setTop(14).setWidth(newWidth).setHeight(newHeight).setRotation(0);
        var ui = SlidesApp.getUi();
        // ui.alert (imgWidth);
        pageElements[i].select(false);
        }
        }





        share|improve this answer












        I got it! This is for the current slide, but I guess I may do the same for all the slides, one at a time.



        function rearrangeImages() {
        //Select current page
        var currentPage = SlidesApp.getActivePresentation().getSelection().getCurrentPage();
        var slide = currentPage;
        //Get all the images of CurrentPage
        var pageElements = slide.getImages();
        //For each image, change the size and position
        for (var i = 0; i < pageElements.length; i++) {
        pageElements[i].select(true);
        var image = pageElements[i];
        var imgWidth = image.getWidth();
        var newWidth = 690;
        var imgHeight = image.getHeight();
        var forhold = imgHeight/imgWidth;
        var newHeight = forhold*newWidth;
        image.setLeft(14).setTop(14).setWidth(newWidth).setHeight(newHeight).setRotation(0);
        var ui = SlidesApp.getUi();
        // ui.alert (imgWidth);
        pageElements[i].select(false);
        }
        }






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 21 hours ago









        Ingeborg

        527




        527






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53373460%2farrange-and-rezise-all-images-in-google-slides%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            Refactoring coordinates for Minecraft Pi buildings written in Python