Control Google Docs embedded viewer with JavaScript

前端 未结 1 1192
轻奢々
轻奢々 2021-02-14 10:16

I need to control the embedded Google Docs viewer in my site. More specifically I need to be able to enable/disable the controls for Google Slides view and to be able to start/s

相关标签:
1条回答
  • 2021-02-14 10:22

    Google Docs doesn't work like that at all. Here are the steps you will need to take.

    1: Create Presentation on Google Slides.
       1a: https://docs.google.com/presentation/u/0/
    2: Create any scripts you want applied in the script editor.
       2a: https://developers.google.com/apps-script/guides/slides/
    3: Publish Presentation. 
       3a: File>Publish to Web>Embed
    4: Embed Presentation.
    5: Create HTML Function call
    6: Create Listener w/ Google Docs (Not on your site.)
    

    If you want your site to be able to access and run scripts from google (Aka, disable controls.) Refer to this link below, it will show you how you can use HTML to request that a script is run from google docs. Keep in mind there is a limitation to daily function calls for free accounts w/ google. I believe it's 5500 calls per day max.

    HTML Function Calls: https://developers.google.com/apps-script/guides/html/communication

    You also mentioned iFrame, you can find information about that located here.

    iFrame Sandboxing: https://developers.google.com/apps-script/migration/iframe

    0 讨论(0)
提交回复
热议问题