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>
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!
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!
Copy link to clipboard
Copied
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.