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

Links to pdf from with in the api seemt problematic

Contributor ,
Apr 19, 2024 Apr 19, 2024

Copy link to clipboard

Copied

I have noticed when i use Full Window Embed Mode   That  it works if the PDF and  HTML is in the same directory   Or  if I place  the HTML in the root  directory  and place the pdf elsewhere  It works perfectly 

But if I move the HTML  to a directory other than root the pdf will not  load unless the pdf is in the same directory  I have  tried  using  the full location in the API   ie  HTTP://www.domain etc    or relative path  ../  none work  anyone know  how I might overcome this 

Views

172

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 ,
Apr 19, 2024 Apr 19, 2024

Copy link to clipboard

Copied

How is it not working? Is it not just loading? If you can share some code you tried, I can try to help more. 

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
Contributor ,
Apr 19, 2024 Apr 19, 2024

Copy link to clipboard

Copied

Hi the interface appears the load spinner starts, and then I have a blank file  it seems to retain the colour  of the viewer   so the HTML has loaded  not the pdf  

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
Contributor ,
Apr 19, 2024 Apr 19, 2024

Copy link to clipboard

Copied

This works in root 

<script src="https://documentservices.adobe.com/view-sdk/viewer.js"></script>
<script type="text/javascript">
	document.addEventListener("adobe_dc_view_sdk.ready", function(){ 
		var adobeDCView = new AdobeDC.View({clientId: "Credential", divId: "adobe-dc-view"});
		adobeDCView.previewFile({
			content:{location: {url: "images/LM_12Page_Folder.pdf"}},
			metaData:{fileName: "LM_12Page_Folder.pdf"}
		}, {defaultViewMode: "FIT_PAGE", showAnnotationTools: false, showDownloadPDF: false, 
			showPrintPDF: false});
	});
</script>

 

This fails when the HTML is in  a subdirectory   I have also tried ../images/LM_12Page_Folder.pdf as  the location 

 

<script src="https://documentservices.adobe.com/view-sdk/viewer.js"></script>
<script type="text/javascript">
	document.addEventListener("adobe_dc_view_sdk.ready", function(){ 
		var adobeDCView = new AdobeDC.View({clientId: "Credential", divId: "adobe-dc-view"});
		adobeDCView.previewFile({
			content:{location: {url: "http://www.domain.com/images/LM_12Page_Folder.pdf"}},
			metaData:{fileName: LM_12Page_Folder.pdf"}
		}, {defaultViewMode: "FIT_PAGE", showAnnotationTools: false, showDownloadPDF: false, 
			showPrintPDF: false});
	});
</script>

 

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
Contributor ,
Apr 19, 2024 Apr 19, 2024

Copy link to clipboard

Copied

Just to clarify  both work in root  and nether work  when the HTML file is in a sub-directory 

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 ,
Apr 19, 2024 Apr 19, 2024

Copy link to clipboard

Copied

You are trying to load it via http, and you are probably on https, so it's going to be blocked. 

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
Contributor ,
Apr 19, 2024 Apr 19, 2024

Copy link to clipboard

Copied

LATEST

Ok Thank you   This  has helped me isolate  where the real problem is Rushing to test without the https broadening the error   getting this correct solves the testing and points where the issue  might be It is either with my modal  Box  or the pdf documents  management and protection software  thanks again 

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