Addobe PDF embed API js
Hello all,
I am attempting to utilize Adobe Document Services pdf Embed API for viewing pdf documents on my website. Following is what I've done so far.
However, as noted below, when I plug in my information, the pdf, which is on my web server, does not open either locally or on the Wordpress web page
that I created on my website. Can anyone see where things are going wrong when I plug my info into the js code?
I added this code to my website header. I must have seen somewhere in the documentation to do this.
<!-- Adobe PDF viewer -->
<script src="[URL]https://documentcloud.adobe.com/view-sdk/main.js[/URL]"></script>
adobe’s original code, which when I create an html page with Brackets works locally on my iMac and opens their sample pdf
[I]<!--Get the samples from https://www.adobe.com/go/pdfembedapi_samples-->[/I]
2<!DOCTYPE html>
3<html>
4<head>
5 <title>Adobe Document Services PDF Embed API Sample</title>
6 <meta charset="utf-8"/>
7 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
8 <meta id="viewport" name="viewport" content="width=device-width, initial-scale=1"/>
9</head>
10<body style="margin: 0px">
11 <div id="adobe-dc-view"></div>
12 <script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
13 <script type="text/javascript">
14 document.addEventListener("adobe_dc_view_sdk.ready", function()
15 {
16 var adobeDCView = new AdobeDC.View({clientId: "<YOUR_CLIENT_ID>", divId: "adobe-dc-view"});
17 adobeDCView.previewFile(
18 {
19 content: {location: {url: "https://documentcloud.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf"}},
20 metaData: {fileName: "Bodea Brochure.pdf"}
21 });
22 });
23 </script>
24</body>
25</html>
my info ( client ID line 16, location URL line 19 and fileName line 20 ) added to the adobe js for pdf viewer, for some reason this code does not open my pdf in the same html page that I created with Brackets application, locally on my iMac
[I]<!--Get the samples from https://www.adobe.com/go/pdfembedapi_samples-->[/I]
2<!DOCTYPE html>
3<html>
4<head>
5 <title>Adobe Document Services PDF Embed API Sample</title>
6 <meta charset="utf-8"/>
7 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
8 <meta id="viewport" name="viewport" content="width=device-width, initial-scale=1"/>
9</head>
10<body style="margin: 0px">
11 <div id="adobe-dc-view"></div>
12 <script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
13 <script type="text/javascript">
14 document.addEventListener("adobe_dc_view_sdk.ready", function()
15 {
16 var adobeDCView = new AdobeDC.View({clientId: "[I]9e027e843aed49019268cbfb1f806c1d[/I]", divId: "adobe-dc-view"});
17 adobeDCView.previewFile(
18 {
19 content: {location: {url: "[I]https://dennisroliff.com/inspiration.pdf[/I]"}},
20 metaData: {fileName: “inspiration.pdf"}
21 });
22 });
23 </script>
24</body>
25</html>
Does anyone see where things are going wrong with my embed?
Thanks.
Dennis
