diff --git a/Sheets2Slide/Code.gs b/Sheets2Slide/Code.gs new file mode 100644 index 0000000..7fca884 --- /dev/null +++ b/Sheets2Slide/Code.gs @@ -0,0 +1,30 @@ +/** + Convert sheet row to a slide. + This works with a particular type of theme for this particular script. +*/ + +function pushToSlide(data){ + + var data = SpreadsheetApp.getActiveSheet().getDataRange().getValues(); + + var slideMain = SlidesApp.create('PRESENTATION NAME'); + var slide = slideMain.insertSlide(0); + + var mainImage = slide.insertImage(data[0][2], 75 , 10 , 200 , 125); + + var line = slide.insertLine(SlidesApp.LineCategory.STRAIGHT, 75 , 110, 100 , 110) + var shape = slide.insertShape(SlidesApp.ShapeType.TEXT_BOX, 70, 135, 300, 30); + var textRange = shape.getText(); + var text = textRange.setText(data[0][1]); + text.getTextStyle().setFontFamilyAndWeight('Roboto', 400).setFontSize(14); + + var line = slide.insertLine(SlidesApp.LineCategory.STRAIGHT, 75 , 190, 100 , 190) + var shape = slide.insertShape(SlidesApp.ShapeType.TEXT_BOX, 70, 200, 300, 30); + var textRange = shape.getText(); + var text = textRange.setText(data[0][3]); + text.getTextStyle().setFontFamilyAndWeight('Roboto', 100).setFontSize(10.5).setForegroundColor('#333333'); + + var cc = SpreadsheetApp.getActiveSheet().getCharts()[0]; + slide.insertSheetsChart(cc, 425 , 50 , 250 , 250) + +} diff --git a/Sheets2Slide/README.md b/Sheets2Slide/README.md new file mode 100644 index 0000000..4f83364 --- /dev/null +++ b/Sheets2Slide/README.md @@ -0,0 +1,14 @@ +[![Screenshot](screenshot.png)](screenshot.png) +---- +## Open a sheet + +### Fill the row in this structure + +| COLUMN 1 | COUMN 2 | COLUMN 3 | COUMN 4 | +| ------ | ------ | ------ | ------ | +| FYI : slide ref | Main title | Main image/logo {URL} | A Paragraph | + +If needed you can generate a chart in the same sheet (can be data from other sheet too). + +Open SCript editor and paste the code from Code.gs file and hit Run. + diff --git a/Sheets2Slide/screenshot.png b/Sheets2Slide/screenshot.png new file mode 100644 index 0000000..feff509 Binary files /dev/null and b/Sheets2Slide/screenshot.png differ