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>
-->
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...
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...
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?
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.
Copy link to clipboard
Copied
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.
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:
Hope this helps solve the issue.
Regards
Adnan