• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

API Code is not loading correctly on site?

New Here ,
Mar 17, 2021 Mar 17, 2021

Copy link to clipboard

Copied

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.png

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

Views

291

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 Expert ,
Mar 17, 2021 Mar 17, 2021

Copy link to clipboard

Copied

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:

Votes

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