Skip to main content
Participant
August 23, 2022
Answered

Adobe Embed Api With Different Domain / PDF From third parties

  • August 23, 2022
  • 1 reply
  • 961 views

Hi, I'm having trouble displaying a pdf on my web page.

Here is the background:
- My website has the web domain example.com
- But my pdf is in google storage which is of course a different domain. (storage.googleapis.com).

Problem:
- I can't run adobe embed api with the above background.

Question:
- Is it possible for me to run adobe embed api with a different domain as in the background above?
- Is there a workaround for pdfs obtained from third parties such as Google Storage or AWS S3?

This topic has been closed for replies.
Correct answer Joel Geraci

You just need to have a direct URL to the PDF and to have CORS set up on the server that the PDF resides on to allow it. Alternatively, you can fetch the PDF from the server and pass it to Embed API via a Promise that resolves to a ByteArray. 

1 reply

Joel Geraci
Community Expert
Joel GeraciCommunity ExpertCorrect answer
Community Expert
August 23, 2022

You just need to have a direct URL to the PDF and to have CORS set up on the server that the PDF resides on to allow it. Alternatively, you can fetch the PDF from the server and pass it to Embed API via a Promise that resolves to a ByteArray. 

Participant
August 25, 2022

Thanks for the answer but do you know how to enabling CORS on Google Cloud Storage?
I've been looking for this in a whole day but still got nothing.
Thankyou!

Participant
August 26, 2022

I think i found a solution.
Here's the configuration cors for google cloud storage:
https://cloud.google.com/storage/docs/configuring-cors

It solved, Thankyou!