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.
google-apps-script google-slides-api google-slides
|
show 3 more comments
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.
google-apps-script google-slides-api google-slides
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 ofThe 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
|
show 3 more comments
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.
google-apps-script google-slides-api google-slides
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
google-apps-script google-slides-api google-slides
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 ofThe 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
|
show 3 more comments
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 ofThe 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
|
show 3 more comments
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);
}
}
add a comment |
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);
}
}
add a comment |
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);
}
}
add a comment |
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);
}
}
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);
}
}
answered 21 hours ago
Ingeborg
527
527
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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