Testing view sdk pdf embed on localhost

Community Beginner ,
Mar 26, 2020 Mar 26, 2020

Copy link to clipboard

Copied

Hi hi have created my client credentials so I can embed pdfs in my angular application. but I can not get the viewer to display via localhost

TOPICS
How to

Views

11.5K

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
Adobe Employee ,
Mar 31, 2020 Mar 31, 2020

Copy link to clipboard

Copied

Hi, Thanks for raising the point. Ideally it should work, can you provide more information here so that we can see why is it not working. Following information will help: client Id, domain on which you are using it, how are you invoking the SDK and any error if you are seeing in developer console. Thanks.

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 ,
Apr 07, 2020 Apr 07, 2020

Copy link to clipboard

Copied

Just add "localhost" in App Domain while generating a API key and you will be all set to load the viewer on your Localhost. Also, make sure you are accessing Localhost in your browser with localhost in domain, not the IP address

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
Adobe Employee ,
Apr 07, 2020 Apr 07, 2020

Copy link to clipboard

Copied

agarwalc is correct. When you create your credentials at https://www.adobe.io/apis/documentcloud/dcsdk/gettingstarted.html, you set your domain to localhost.

 

Also, if you aren't using a web server and you are just loading a file from file:// then it does not need a client ID.

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
Community Beginner ,
May 31, 2020 May 31, 2020

Copy link to clipboard

Copied

How does one allow "localhost" as an app domain?  When I try adding it, console.adobe.io is rejecting me and saying "Domain localhost is invalid"

 

r002_0-1590989806200.png

 

Thank you for helping!

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
Adobe Employee ,
Jun 02, 2020 Jun 02, 2020

Copy link to clipboard

Copied

Please try creating the credentials from https://www.adobe.io/apis/documentcloud/dcsdk/viewsdk.html .

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 ,
Aug 25, 2020 Aug 25, 2020

Copy link to clipboard

Copied

I am having the same issue too trying to use localhost:3000.  I am not able to get a key for Embed API.

When I try the above link. the page looks to be missing syles and modt of the links get a 404 error.  

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 ,
Aug 06, 2020 Aug 06, 2020

Copy link to clipboard

Copied

I'm facing the same problem. If i Use the clientID from PDF Embed API, with domain set to localhost I get this error. When I use the PDF Tools API clientID, it says This application domain (http://localhost:3000) is not authorized to use the provided View SDK Client ID.  

Kindly help

image.png

 
 

 

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
Adobe Employee ,
Apr 18, 2021 Apr 18, 2021

Copy link to clipboard

Copied

Hi All, 

 

Thanks for all the responses. Now we can create credentials with localhost domain from console.adobe.io as well.

 

Although the best place to create credentials is https://www.adobe.io/apis/documentcloud/dcsdk/viewsdk.html

 

 

Thanks

Harender

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
Explorer ,
Jul 20, 2020 Jul 20, 2020

Copy link to clipboard

Copied

I too am trying to test and getting the same error while setting localhost

 

Screenshot from 2020-07-21 11-08-48.png

 

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 ,
Aug 21, 2020 Aug 21, 2020

Copy link to clipboard

Copied

Has anyone solved this?  It seems like you can't add localhost to the credentials

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 ,
Aug 25, 2020 Aug 25, 2020

Copy link to clipboard

Copied

I too am looking for the solution.

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 ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

This works as of 8/21/2020

 

You can just write "localhost" into the "allowed domain" form field. To run in your local dev environment, map the URL to "localhost" AND port to "80", the default internet port. It may take a few minutes for "localhost" to propogate to your allowed domains. Startup your local server ( with the URL and port bindings just described ) and point your browser to "localhost". 

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 ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

I must be in a different universe because every time I type localhost to configure the API in the adobe console it says Domain localhost is invalid.  Here is a picture as of today 8/28.

 

Is there anything else's you can point me too or is there some other way to create the api.

 

https://share.getcloudapp.com/7KuLkoqx 

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
Adobe Employee ,
Aug 31, 2020 Aug 31, 2020

Copy link to clipboard

Copied

Hi,

 

Sorry for the inconvenience, this issue has already been raised to the concerned team. You have an alternate way (which is recommended though) to create your credentials via below ICA app.

 

https://www.adobe.io/apis/documentcloud/dcsdk/gettingstarted.html#

 

Please let us know if you further face any issue.

 

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
Community Beginner ,
Oct 26, 2020 Oct 26, 2020

Copy link to clipboard

Copied

I have tried with the new create credentials link but still localhost is not an allowed domain. Any ideas on what else to try because we are blocked on local development.

Screen Shot 2020-10-26 at 4.36.08 PM.pngScreen Shot 2020-10-26 at 4.37.41 PM.png

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
Adobe Employee ,
Oct 28, 2020 Oct 28, 2020

Copy link to clipboard

Copied

Hi, could you please share the code snippet where you are using the credentials? If you see any error in the developer console, please share that as well.

Thanks!

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
Community Beginner ,
Oct 28, 2020 Oct 28, 2020

Copy link to clipboard

Copied

Thanks for your response! We actually figured it out. We were testing it out in a shared storybook environment and another story had mocked out the global fetch which was causing some of the adobe API calls to fail. 

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 ,
Sep 08, 2022 Sep 08, 2022

Copy link to clipboard

Copied

Resurrection of an old topic. Our application is set to run at localhost:8100 in testing instead of localhost:80 and I get 

JustACodeMonkey_0-1662652565819.png

When I tried to create the credentials with the port number, it fails. Is there a way to use non port 80 URLs?

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 ,
Sep 08, 2022 Sep 08, 2022

Copy link to clipboard

Copied

Update - I am now running on port 80 and receive the same error

 

JustACodeMonkey_0-1662658322881.png

It's interesting, because I can see the PDF load and display briefly before that error is displayed and the PDF removed.

 

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
Adobe Employee ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

The port should not matter. When you created the credentials, did you use "localhost" (no port) as the domain?

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 ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

Yes, localhost is used without a port on the credentials.

JustACodeMonkey_0-1662736473401.png

 

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
Adobe Employee ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

Can you share the snippet of your HTML file where you used Embed? 

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 ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

I was using the demo code

 

<div id="adobe-dc-view" style="height: 360px; width: 500px;"></div>
<script src="https://documentcloud.adobe.com/view-sdk/viewer.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: "<PATH_TO_MY_FILE>"}},
      metaData:{fileName: "<MY_FILE_NAME>"}
    },
    {
      embedMode: "SIZED_CONTAINER"
    });
  });
</script>

 

I can see the PDF load correctly into the container. After it loads, it throws up the error message and removes the PDF.

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
Adobe Employee ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

Did you change the client id? Did you change it _completely_? Ie, not <real id>, but just the id.

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
Resources