Skip to main content
Inspiring
April 19, 2024
Question

Links to pdf from with in the api seemt problematic

  • April 19, 2024
  • 1 reply
  • 855 views

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 

    This topic has been closed for replies.

    1 reply

    Raymond Camden
    Community Manager
    Community Manager
    April 19, 2024

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

    Inspiring
    April 19, 2024

    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  

    Inspiring
    April 19, 2024

    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>