Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
5

Testing view sdk pdf embed on localhost

Community Beginner ,
Mar 26, 2020 Mar 26, 2020

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
28.4K
Translate
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

Yes, the < and > were removed from the code for the clientId, url, and fileName.

Translate
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

Could you share the full code? You can email it to me at jedimaster@adobe.com. 

Translate
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

It's part of a giant Angular application. I'll try to recreate the error with a smaller app.

Translate
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

That's always a good idea. Also, do you see anything in the console?

Translate
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

I'll have to re-add the code. When it stopped working yesterday, I removed everything and went another route.

Translate
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

The only error in the console has to do with Adobe logging services. 

JustACodeMonkey_0-1662750850938.png

I tried in the minimal app and it seems to be OK there, so it must be something in our larger app that is breaking it.

I don't think I can use PDF embed anyway because we have multiple URLs for the same build bundle and from what I can see, the developer console only allows one URL per key (we need 1 key for multiple domains).

Thanks for the help you've provided.

Translate
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

Yeah, it's one domain per key. You can make multiple keys and use environment variables in your build process. 🙂

Translate
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

Ya, we use environment variables now, but they're shared across our various dev domains (that's the big issue). I'm investigating other alternatives for now.

Translate
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 ,
Jun 13, 2023 Jun 13, 2023

I'm also getting this error. How long does it take to propogate the allowed domains?

 

Screenshot 2023-06-13 at 5.12.23 PM.pngScreenshot 2023-06-13 at 5.12.48 PM.png

Translate
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 14, 2023 Jun 14, 2023

It should be very fast. Are you sure you used http://localhost for the domain?

Translate
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 ,
Jun 14, 2023 Jun 14, 2023

Yes

Translate
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 ,
Jun 14, 2023 Jun 14, 2023

I should note when I go to add the credentials I get a message saying there was an error creating the credentials but they were created anyway. The adobe developer console needs work.

Translate
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 ,
Jun 14, 2023 Jun 14, 2023
{
    "errors": [
        {
            "message": "400: Bad Request",
            "locations": [
                {
                    "line": 2,
                    "column": 3
                }
            ],
            "path": [
                "subscribeWorkspaceIntegrationToServices"
            ],
            "extensions": {
                "code": "INTERNAL_SERVER_ERROR",
                "response": {
                    "status": 400,
                    "statusText": "Bad Request",
                    "body": {
                        "id": "88d656d7-088a-4419-9365-0f60240c9258",
                        "messages": [
                            {
                                "template": "ERR_MSG_BAD_REQUEST",
                                "message": "400 BAD_REQUEST {\"reason\":\"bad_request_body:invalid_domain\",\"message\":\"Invalid domain provided\"}"
                            }
                        ]
                    }
                }
            }
        }
    ],
    "data": {
        "subscribeWorkspaceIntegrationToServices": null
    }
}
Translate
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 ,
Jun 14, 2023 Jun 14, 2023

I looked at the request from the console to your backend services and this is the response

{
"errors": [
{
"message": "400: Bad Request",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"subscribeWorkspaceIntegrationToServices"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"response": {
"status": 400,
"statusText": "Bad Request",
"body": {
"id": "88d656d7-088a-4419-9365-0f60240c9258",
"messages": [
{
"template": "ERR_MSG_BAD_REQUEST",
"message": "400 BAD_REQUEST {\"reason\":\"bad_request_body:invalid_domain\",\"message\":\"Invalid domain provided\"}"
}
]
}
}
}
}
],
"data": {
"subscribeWorkspaceIntegrationToServices": null
}
}

Translate
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 ,
Jun 14, 2023 Jun 14, 2023

Screenshot 2023-06-14 at 8.40.47 AM.png

Translate
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 ,
Jun 14, 2023 Jun 14, 2023

This keeps happening over and over

Translate
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 14, 2023 Jun 14, 2023

Not sure what to tell you - I just went to a project, added the PDF Embed API, set localhost, and it worked. Can you try in a new project perhaps?

Translate
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 ,
Jun 14, 2023 Jun 14, 2023

I don't understand how it gives me a 400 BAD_REQUEST. Your backend is not accepting localhost as a domain. It says so in the response above.

Translate
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 ,
Jun 14, 2023 Jun 14, 2023

Ok so I figured out the issue. The console says you can add up to 5 domains comma separated but if you add more than one it throws an error and doesn't work.

Translate
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 ,
Jun 14, 2023 Jun 14, 2023

Please pass this onto your developers to fix.

Translate
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 14, 2023 Jun 14, 2023

I can confirm and will report.

Translate
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 ,
Jun 14, 2023 Jun 14, 2023

Thank you.

Translate
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 ,
Jun 15, 2023 Jun 15, 2023

I'm also getting this error. At first I was adding 2 domains. I read the latest answer with the error on multiple domains. So I created a new project with only localhost in allowed domains. I'm getting the error in React app running on port 3005 (see attached screenshots).

Translate
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 15, 2023 Jun 15, 2023

I have never had an issue with nonstandard ports. Do you mind sharing the key you used?

Translate
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 ,
Jun 15, 2023 Jun 15, 2023

Hi Raymond. I've messaged you the key.

Translate
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