Copy link to clipboard
Copied
I successfully integrated on one site I manage for work with no issues, however on the other site I manage in a volunteer role I'm seeing the issue that the "File Preview is Not Available. This application domain (http://phadp.org) is not authorized to use the provided View SDK Client ID."
I've double checked the key and the domain I used when registering, but I cannot figure out why I continue to get this message.
Any help would be appreciated.
Copy link to clipboard
Copied
Hi Malkayah, Thanks for using View SDK, It is because you whitelisted API Key for domain www.phadp.org but you are trying to access your website by phadp.org domain.
http://www.phadp.org/?q=node/832 This is working.
Copy link to clipboard
Copied
Thanks for the reply. Is there a way to add both variations of the domain to the whitelist? Obviously I have no control over how end users chose to visit the domain.
Copy link to clipboard
Copied
Please create the API key for "phadp.org" then it should work for both variations of the domain. Thanks.
Copy link to clipboard
Copied
I did as suggested, and it works for "phadp.org" but when I manually type "www.phadp.org" I get a different file preview error. This one does not saw it is not authorized, but says, "Please reload to try again". Reloading does nothing.
Copy link to clipboard
Copied
Issues is occurring because of Cross-origin resource sharing (CORS) which says webpage and file location URL needs to be on the same domain. Example: webpage: https://example.com/viewer/test.html; PDF location: https://example.com/resources/abc.pdf)
In your case, it looks like you are passing the PDF URL as http://phadp.org/files/owoh/owoh24_2.pdf, if you pass the File location URL relative to your domain like "/files/owoh/owoh24_2.pdf", then it should work in both cases.
Copy link to clipboard
Copied
That did the trick. Thanks!
Copy link to clipboard
Copied
Hello,
Can someone help me? I'm also facing the same problem.
I created a credential ID for my domain www.roundstudy.com using this Link
and then created a html code on live demo https://www.adobe.com/go/dcviewsdk_demo for my pdf that I uploaded from my local folder. I pasted that code on my iFrame
HTML Code: <div id="adobe-dc-view"></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: "9f1b28edec7b42fcb3581a1a501373d9", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content:{promise: "<FILE_BLOB_PROMISE>"},
metaData:{fileName: "<FILE_NAME>"}
}, {});
});
</script>
credit id: 9f1b28edec7b42fcb3581a1a501373d9
Domain name: www.roundstudy.com.
but when I upload the code on my website there is an error: "File Preview is Not Available. This application domain (xxxxxxxxxxxxxxx) is not authorized to use the provided View SDK Client ID."
Am I following the right process? Could someone guide me through it
Copy link to clipboard
Copied
Hi there, could you be more specific on where are you locating the pdf file, and in which url are embeding the script?
Copy link to clipboard
Copied
I've located the file in my local drive. I don't know how to get the source url for the file. The url where I'm embeding the script is roundstudy.com
Copy link to clipboard
Copied
Thats the problem, the pdf file should be on your website, or in any other site that you could host the pdf file. Also the url should be a direct link, that means that the pdf file will begin to download as soon as the moment you access to that url.
Copy link to clipboard
Copied
Thank you @German5FFC for the help. Could you suggest me some site where I can keep my pdf and use the link. I was thinking of using Mega where I can upload all my files and use the link as pdf source. Could you also confirm if the steps I'm following are they correct?
Copy link to clipboard
Copied
Dropbox, Google Drive are good options too. Keep in mind that there are limits on how many people can access that file. And do not forget the difference between a direct link and a link to a file. For example
link to a file: https://www.dropbox.com/s/3epmnxwhrnk7lgd/Bodea%20Brochure.pdf?dl=0
direct link: https://dl.dropboxusercontent.com/s/3epmnxwhrnk7lgd/Bodea%20Brochure.pdf
Copy link to clipboard
Copied
Google drive is a better option which link should I be using as source link (Link to file / direct link). Is this code correct ?
<div id="adobe-dc-view"></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: "9f1b28edec7b42fcb3581a1a501373d9", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content:{promise: "<FILE_BLOB_PROMISE>"},
metaData:{fileName: "<FILE_NAME>"}
}, {});
});
</script>
Do different webpages require differnt clinet id
e.g. if I have Client Id a3463456 for a domain name ww.roundstudy.com can i use the same client ID for
Copy link to clipboard
Copied
The code is ok.
And no, the client id is the same for every page of your domain.
Copy link to clipboard
Copied
Thank you very much @German5FFC . I'll try this and see if it works.
Copy link to clipboard
Copied
Hi @German5FFC
I'm still facing the same issue. When i load the code in my iframe this error appears
The code I use is
<div id="adobe-dc-view"></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: "9f1b28edec7b42fcb3581a1a501373d9", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content:{location: {url: "https://dl.dropboxusercontent.com/s/u9dmuz8dx5jtddr/Visning%20af%20PDF%20i%20MB%2001.pdf"}},
metaData:{fileName: "Visning af PDF i MB 01.pdf"}
}, {});
});
</script>
I'm using dropbox for my pdf location and the direct link is "https://dl.dropboxusercontent.com/s/u9dmuz8dx5jtddr/Visning%20af%20PDF%20i%20MB%2001.pdf"
My domain name is "www.roundstudy.com".
Please help
Copy link to clipboard
Copied
Try to register the domain that the error is showing
Copy link to clipboard
Copied
I tried it and it's working now thank you very much ☺️☺️☺️ @German5FFC
Copy link to clipboard
Copied
😄
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You should set showAnnotationTools on false.
For example:
var adobeDCView = new AdobeDC.View({clientId: "blablabla1", divId: adobe-dc-view});
adobeDCView.previewFile({
content:{location: {url: url}},
metaData:{fileName: name}
}, {embedMode: "FULL_WINDOW", showAnnotationTools: false});
Copy link to clipboard
Copied
@German5FFC But I want require the highlight pen option but not the commnet feature
Copy link to clipboard
Copied
Highlights are comments. They are one of the many comment types available in PDF.
Copy link to clipboard
Copied
Im not really sure if you can, I strongly advise you to check the documentation. If you are desperate, you can hide them with css. Every button you see has an id (stickyNote, highlight, freehandTool, etc).