var NAME = "猫";
var presentation = SlidesApp.create(NAME);
function addImageSlide(imageUrl, index) {
var slide = presentation.appendSlide(SlidesApp.PredefinedLayout.BLANK);
var image = slide.insertImage(imageUrl);
var imgWidth = image.getWidth();
var imgHeight = image.getHeight();
var pageWidth = presentation.getPageWidth();
var pageHeight = presentation.getPageHeight();
var newX = pageWidth/2. - imgWidth/2.;
var newY = pageHeight/2. - imgHeight/2.;
image.setLeft(newX).setTop(newY);
}
function addImageSlidex(ix, index) {
var slide = presentation.appendSlide(SlidesApp.PredefinedLayout.BLANK);
bon=DriveApp.getFileById(ix).getBlob()
var image = slide.insertImage(bon);
var imgWidth = image.getWidth();
var imgHeight = image.getHeight();
var pageWidth = presentation.getPageWidth();
var pageHeight = presentation.getPageHeight();
var newX = pageWidth/2. - imgWidth/2.;
var newY = pageHeight/2. - imgHeight/2.;
image.setLeft(newX).setTop(newY);
}
function main() {
var imx = [
"http://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png",
"http://www.google.com/services/images/phone-animation-results_2x.png",
"http://www.google.com/services/images/section-work-card-img_2x.jpg",
"http://gsuite.google.com/img/icons/product-lockup.png",
"http://gsuite.google.com/img/home-hero_2x.jpg"
];
var [title, subtitle] = presentation.getSlides()[0].getPageElements();
title.asShape().getText().setText(NAME);
subtitle.asShape().getText().setText("ce00582");
for(s=0;s<3;s++){
addImageSlide(imx[s],s+1);
}
addImageSlidex("1owNa_x_ZjjkWYwDvCnnOaFB5seJR5TwyIg",3);
}
最終更新:2017年10月05日 11:43