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
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.
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
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>
Copy link to clipboard
Copied
Just to clarify both work in root and nether work when the HTML file is in a sub-directory
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.
Copy link to clipboard
Copied
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