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

API Code is not loading correctly on site?

New Here ,
Mar 17, 2021 Mar 17, 2021

I am using the code snippet from the Document Service PDF embed API service, which is not working correctly on my end.

I am getting the following error:

Error.pngexpand image

Here is the code I am using:

<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: "6d2b4b4b70c64a0c9b71a2fed484e645"});
		adobeDCView.previewFile({
			content:{location: {url: "http://www.corclinic.com/downloads/COR_PhxMag_reprint_0408.pdf"}},
			metaData:{fileName: "COR_PhxMag_reprint_0408.pdf"}
		}, {embedMode: "LIGHT_BOX"});
	});
</script>

Can the source PDF be from any website, or does it have to be stored on the adobe cloud for this work? Thank you

TOPICS
Document Generation API , How to , PDF Embed API
390
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 Expert ,
Mar 17, 2021 Mar 17, 2021
LATEST

from the documentation...

Cross-origin resource sharing (CORS) issues may occur when you pass PDF content as a URL and the PDF Embed API needs to download the file from the provided location in order to render it. To avoid this situation, you can choose one of two methods:

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