Problems with Custom Slides presentation dimensions

264 views
Skip to first unread message

Brett Grear

unread,
Mar 14, 2021, 7:37:17 PM3/14/21
to Google Apps Script Community
I am working on an add-on.  Part of its functionality is that it needs to create a Slides Presentation that has custom width and height.
Through research, I have found that it isn't possible to create a new presentation through the SlidesApp or Advanced Slides API and that the only real way is to make a copy of a pre-made template.

Herein lies the problem.  My add-on only has access to drive.file scope.  I'm not asking the users to choose the template in a Picker as they don't have access to it at all.  Currently the template is sitting on My Drive and is set to be accessible by anyone with the link.

I have also tried using Drive.Files.insert(resources,blob) but this creates a Google Doc version of my file instead of a Slides presentation, even when I indicated the mimeType: application/vnd.google-apps.presentation in the resource object.

My questions are therefore:
  1.  Is there any way to use Drive.Files.copy to make a copy of a file that is accessible with the ID but hasn't been given express permission on that add-on?
  2. Is there a way to use Drive.Files.insert to take a blob of the file and create a Slides presentation?
  3. Is there a way to create a new Slides presentation with custom slide dimensions?
  4. Is there another way to solve my problem that I'm yet to think of.
Thanks in advance

Brett

Tanaike

unread,
Mar 14, 2021, 9:24:59 PM3/14/21
to Google Apps Script Community
About "it needs to create a Slides Presentation that has custom width and height.", in order to compensate the processes that Slides service and Slides API cannot achieve, I created a Google Apps Script library. https://github.com/tanaikech/DocsServiceApp

When this library is used, the Google Slides with the custom page size can be created. The document is here.

If this was not the direction you expect, I apologize.


Brett Grear

unread,
Mar 15, 2021, 3:08:32 AM3/15/21
to Google Apps Script Community
This is amazing!
Thank you! This is exactly what I needed.  
Works perfectly!

Bruce Mcpherson

unread,
Mar 15, 2021, 5:28:05 AM3/15/21
to google-apps-sc...@googlegroups.com
Hi Tanaike

Would love to get your stuff on scrviz. You have some great libraries.

However I noticed that you don't have any appsscript.json manifests in your repos. Here's the stats of what we've picked up from repos with manifests in the past month.

image.png

All you have to do to get included is push your manifest file to github along with your code.

cheers
bruce





--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/a907a7b1-0220-4412-b9ac-adcf43fae381n%40googlegroups.com.

Tanaike

unread,
Mar 21, 2021, 1:45:46 AM3/21/21
to Google Apps Script Community
Thank you for your comment. And, I apologize for my late reply. Now, as a test for confirming my understanding, I added appsscript.json file to the repository. When I misunderstood your comment, please tell me.

Bruce Mcpherson

unread,
Mar 21, 2021, 6:28:55 AM3/21/21
to google-apps-sc...@googlegroups.com

On Sun, 21 Mar 2021 at 05:45, Tanaike <kanshi...@gmail.com> wrote:
Thank you for your comment. And, I apologize for my late reply. Now, as a test for confirming my understanding, I added appsscript.json file to the repository. When I misunderstood your comment, please tell me.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

Tanaike

unread,
Mar 21, 2021, 9:04:16 AM3/21/21
to Google Apps Script Community
Thank you for checking it. I added appsscript.json in more repositories of GAS library!

Bruce Mcpherson

unread,
Mar 21, 2021, 10:07:33 AM3/21/21
to google-apps-sc...@googlegroups.com
Ok they’ll start showing up over the next couple of days.

On Sun, Mar 21, 2021 at 1:04 PM Tanaike <kanshi...@gmail.com> wrote:
Thank you for checking it. I added appsscript.json in more repositories of GAS library!

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

Bruce Mcpherson

unread,
Mar 21, 2021, 2:52:24 PM3/21/21
to google-apps-sc...@googlegroups.com
Nice job!
image.png

Tanaike

unread,
Mar 21, 2021, 9:53:44 PM3/21/21
to Google Apps Script Community
Thank you for your support. When I publish new GAS library in the future, I would like to add the file of "appsscript.json" to the repository.

Reply all
Reply to author
Forward
0 new messages