Skip to main content
IshtiaqAhmad
Participant
June 15, 2021
Question

Setting up Adobe PDF Embed SDK But in Chrome getting Preview Error

  • June 15, 2021
  • 1 reply
  • 413 views

Hi 

I'm trying to use 'Adobe View' to embed a PDF on a webpage. 

I've followed API documentation to set up.

here is my code:

<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: "062bc24ed9d8496188760affc1770a9b", divId: "adobe-dc-view"});
		adobeDCView.previewFile({
			content:{location: {url: "https://encyclical-ball.000webhostapp.com/PDF-Forms/Fomema_Amendment_Form.pdf"}},
			metaData:{fileName: "Fomema Amendment Form"}
		}, {defaultViewMode: "FIT_WIDTH"});
	});
</script>

the code is working fine in Microsoft Edge, Internet Explorer & Mozilla Firefox but not working in Google Chrome. 

 

Chrome Error:

"File preview not available, please reload to try again." 

 

Is there any idea to fix the error?

This topic has been closed for replies.

1 reply

Participant
June 17, 2021

Hi,
I can preview the file using provided snippet in chrome 91. Could you please share screen shot of error and chrome version you are using? Also, are you running this on a local server or opening HTML file dirctly in browser?

Thanks!