Using PDF Embed API with Google Apps Script HtmlService

New Here ,
Mar 18, 2021 Mar 18, 2021

Copy link to clipboard

Copied

I am trying to use the PDF Embed API on a web app developed with Google Apps Script's HtmlService.

I am using the sample code, with the only change being the updated client ID. When deployed, the error states: "This application domain (https://n-oglre90lc7wy45865lvkriotploicflop75k7o-ppu-script.googleusercontent.com) is not authorized to use the provided PDF Embed API Client ID." When adding the domain to the credential, the url was flagged as invalid with "https://", so I removed the "https://" and it allowed me to enter the domain. The error persists. Can this tool be used with the GAS's HtmlService? If so, how should the domain be entered?

 

<div id="adobe-dc-view"></div>
 <script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
 <script type="text/javascript">
    document.addEventListener("adobe_dc_view_sdk.ready", function()
    {
        var adobeDCView = new AdobeDC.View({clientId: "<YOUR_CLIENT_ID>", divId: "adobe-dc-view"});
        adobeDCView.previewFile(
       {
          content:   {location: {url: "https://documentcloud.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf"}},
          metaData: {fileName: "Bodea Brochure.pdf"}
       });
    });
 </script>

 

TOPICS
How to, PDF Embed API

Views

75

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Mar 18, 2021 Mar 18, 2021
Create a new credential using just "googleusercontent.com", not the full URL without the protocol. 

Likes

Translate

Translate
Adobe Community Professional ,
Mar 18, 2021 Mar 18, 2021

Copy link to clipboard

Copied

Create a new credential using just "googleusercontent.com", not the full URL without the protocol. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 18, 2021 Mar 18, 2021

Copy link to clipboard

Copied

LATEST

That did it! Thank you so much.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines