• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

File Preview Error: Demo works but new PDF does not

New Here ,
Apr 11, 2020 Apr 11, 2020

Copy link to clipboard

Copied

Hey all, 

Cool tool.  But can't get it to run with my own PDF.  Works fine with demo PDF from tool.. so know I have the ClientID and credentials setup.


Works: http://c19rh.org/assets/1/yes.html

Error: http://c19rh.org/assets/1/no.html

Source File reference in no.html: https://c19rh.org/smx.pdf


What am I missing?  Thanks!

 

 

<!-- Works fine with demo PDF from adobe.com -->

<div id="adobe-dc-view" style="height: 760px; width: 800px;"></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: "d6b9af64d40d44bcafe797e71085ecc6", divId: "adobe-dc-view"});
		adobeDCView.previewFile({
			content:{location: {url: "https://documentcloud.adobe.com/view-sdk-demo/PDFs/Summary.pdf"}},
			metaData:{fileName: "Summary.pdf"}
		}, {embedMode: "SIZED_CONTAINER"});
	});
</script>

<!--  Swapped out location URL and file name - get "file preview error". 

<div id="adobe-dc-view" style="height: 760px; width: 800px;"></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: "d6b9af64d40d44bcafe797e71085ecc6", divId: "adobe-dc-view"});
		adobeDCView.previewFile({
			content:{location: {url: "https://c19rh.org/smx.pdf"}},
			metaData:{fileName: "smx.pdf"}
		}, {embedMode: "SIZED_CONTAINER"});
	});
</script>
-->

 

 

TOPICS
PDF Embed API

Views

3.4K

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

New Here , Apr 11, 2020 Apr 11, 2020

Ahh, figured it out.

 

If the PDF link is https://  in the code, then you have to load the page as https://

 

And if the pdf link is NOT secure, then the page has to load not secure... 

Votes

Translate

Translate
New Here ,
Apr 11, 2020 Apr 11, 2020

Copy link to clipboard

Copied

Ahh, figured it out.

 

If the PDF link is https://  in the code, then you have to load the page as https://

 

And if the pdf link is NOT secure, then the page has to load not secure... 

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
New Here ,
Jun 02, 2020 Jun 02, 2020

Copy link to clipboard

Copied

Im having the same issue, but I don't undersand what you mean in your response. Both files (the adobe demo and my file) are https:// so what is it that I need to change to get my file to load?

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
Adobe Employee ,
Jun 02, 2020 Jun 02, 2020

Copy link to clipboard

Copied

Hi, We will be happy to help you, if you can share the more context, it would be great if you can share your snippet along with developer console of the browser if there are any error there.

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
New Here ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

LATEST

Hi there,

After trying all possible hits and trials, I found a solution that worked for me.

Below is the code I was trying and was getting the same File Preview Error. As you can see, the url starts with http and ends with the file name.

im89021061_0-1617058928687.png

 

I just removed the http://syncit.in and gave the rest of the path for the file name like below, and it worked for me:

im89021061_1-1617058928738.png

 

 

Hope this helps solve the issue.

 

Regards

Adnan

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