Skip to main content
Participant
December 7, 2020
Answered

Problems Loading the Embed API on my website.

  • December 7, 2020
  • 1 reply
  • 1416 views

I used this code to embed a pdf viewer on my website, but none of the pdfs I've tried show. I tested with the Document Services PDF Embed API Demo and when I open the file there it opens. However, when I try to use it on the website, it doesn't load. I keep receiving the error "File preview error. File preview not available, please reload to try again."

Here's the code I used

 

<!--Get the samples from https://www.adobe.com/go/pdfembedapi_samples-->
<!DOCTYPE html>
<html>

<head>
	<title>Adobe Document Services PDF Embed API Sample</title>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1" />
</head>

<body style="margin: 0px">
	<div id="adobe-dc-view"></div>
<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: "5ca60f923d3f430ca29cbdd7fc06a442", divId: "adobe-dc-view"});
		adobeDCView.previewFile({
			content:{location: {url: "test.pdf"}},
			metaData:{fileName: "Test pdf"}
		}, {});
	});
</script>
</body>

</html>

 

 

    This topic has been closed for replies.
    Correct answer Sumona Ghosh

    Thanks for using PDF Embed API.

    Please ensure that you are using a direct link to the PDF in your code. Also, do you see any error in the browser console? Would be great if you could share that as well. Thanks! 

    1 reply

    Sumona GhoshCorrect answer
    Adobe Employee
    December 8, 2020

    Thanks for using PDF Embed API.

    Please ensure that you are using a direct link to the PDF in your code. Also, do you see any error in the browser console? Would be great if you could share that as well. Thanks! 

    Participant
    December 8, 2020

    Oh, thank you Sumona. I solved the problem. Actually, Internet Download Manager (IDM) was what was stopping the pdfs from displaying. Thanks for the support.