Problems Loading the Embed API on my website.

New Here ,
Dec 07, 2020 Dec 07, 2020

Copy link to clipboard

Copied

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>

 

 

Views

138

Likes

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

correct answers 1 Correct Answer

Adobe Employee , Dec 08, 2020 Dec 08, 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! 

Likes

Translate

Translate
Adobe Employee ,
Dec 08, 2020 Dec 08, 2020

Copy link to clipboard

Copied

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! 

Likes

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
New Here ,
Dec 08, 2020 Dec 08, 2020

Copy link to clipboard

Copied

LATEST

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.

Likes

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