Skip to content

Commit 041d012

Browse files
committed
Updating View SDK samples
1 parent 571a9f9 commit 041d012

File tree

22 files changed

+399
-24
lines changed

22 files changed

+399
-24
lines changed

Full Window Embed Mode/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Full Window Embed Mode Sample
2+
3+
PDF Viewer fills the entire browser window to provide full immersive view for users to read and act on documents.
4+
To see it in action, copy the files in the folder to your computer, and open index.html in a supported browser.
5+
6+
## Documentation
7+
8+
For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs.
File renamed without changes.

default-view/index.js renamed to Full Window Embed Mode/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ NOTICE: Adobe permits you to use, modify, and distribute this file in
66
accordance with the terms of the Adobe license agreement accompanying
77
it. If you have received this file from a source other than Adobe,
88
then your use, modification, or distribution of it requires the prior
9-
written permission of Adobe.
9+
written permission of Adobe.
1010
*/
1111

1212
/* Control the default view mode */
@@ -33,8 +33,7 @@ document.addEventListener("adobe_dc_view_sdk.ready", function() {
3333
location: {
3434
url: "https://documentcloud.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf",
3535
/*
36-
If accessing file from URL requires some addition headers like "Authorization" etc.
37-
It can be passed in headers.
36+
If the file URL requires some additional headers, then it can be passed as follows:-
3837
headers: [
3938
{
4039
key: "<HEADER_KEY>",

In-Line Embed Mode/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# In-Line Embed Mode Sample
2+
3+
PDF Viewer is embedded in line within the context of the app / web page.
4+
To see it in action, copy the files in the folder to your computer, and open index.html in a supported browser.
5+
6+
## Documentation
7+
8+
For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs.

In-Line Embed Mode/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Adobe Document Cloud View SDK Sample</title>
5+
<meta charset="utf-8"/>
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
7+
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1"/>
8+
<script type="text/javascript" src="index.js"></script>
9+
</head>
10+
<!-- Customize page layout style according to your need and PDF file for best viewing experience -->
11+
<body style="margin: 100px 0 100px 200px;">
12+
<div id="adobe-dc-view" style="width: 800px; box-shadow: 1px 1px 10px 1px #dadada;"></div>
13+
<script type="text/javascript" src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
14+
</body>
15+
</html>

In-Line Embed Mode/index.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
Copyright 2019 Adobe
3+
All Rights Reserved.
4+
5+
NOTICE: Adobe permits you to use, modify, and distribute this file in
6+
accordance with the terms of the Adobe license agreement accompanying
7+
it. If you have received this file from a source other than Adobe,
8+
then your use, modification, or distribution of it requires the prior
9+
written permission of Adobe.
10+
*/
11+
12+
/* Pass the embed mode option here */
13+
const viewerConfig = {
14+
embedMode: "IN_LINE"
15+
};
16+
17+
/* Wait for Adobe Document Cloud View SDK to be ready */
18+
document.addEventListener("adobe_dc_view_sdk.ready", function() {
19+
/* Initialize the AdobeDC View object */
20+
var adobeDCView = new AdobeDC.View({
21+
/* Pass your registered client id */
22+
clientId: "<YOUR_CLIENT_ID>",
23+
/* Pass the div id in which PDF should be rendered */
24+
divId: "adobe-dc-view",
25+
});
26+
27+
/* Invoke the file preview API on Adobe DC View object */
28+
adobeDCView.previewFile({
29+
/* Pass information on how to access the file */
30+
content: {
31+
/* Location of file where it is hosted */
32+
location: {
33+
url: "https://documentcloud.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf",
34+
/*
35+
If the file URL requires some additional headers, then it can be passed as follows:-
36+
header: [
37+
{
38+
key: "<HEADER_KEY>",
39+
value: "<HEADER_VALUE>",
40+
}
41+
]
42+
*/
43+
},
44+
},
45+
/* Pass meta data of file */
46+
metaData: {
47+
/* file name */
48+
fileName: "Bodea Brochure.pdf"
49+
}
50+
}, viewerConfig);
51+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# PDF Preview with Events Sample
2+
3+
This sample shows how to start receiving events from PDF Viewer.
4+
To see it in action, copy the files in the folder to your computer, and open index.html in a supported browser.
5+
6+
## Documentation
7+
8+
For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
Copyright 2019 Adobe
3+
All Rights Reserved.
4+
5+
NOTICE: Adobe permits you to use, modify, and distribute this file in
6+
accordance with the terms of the Adobe license agreement accompanying
7+
it. If you have received this file from a source other than Adobe,
8+
then your use, modification, or distribution of it requires the prior
9+
written permission of Adobe.
10+
*/
11+
12+
/* Wait for Adobe Document Cloud View SDK to be ready */
13+
document.addEventListener("adobe_dc_view_sdk.ready", function() {
14+
/* Initialize the AdobeDC View object */
15+
var adobeDCView = new AdobeDC.View({
16+
/* Pass your registered client id */
17+
clientId: "<YOUR_CLIENT_ID>",
18+
/* Pass the div id in which PDF should be rendered */
19+
divId: "adobe-dc-view",
20+
});
21+
22+
/* Invoke the file preview API on Adobe DC View object */
23+
adobeDCView.previewFile({
24+
/* Pass information on how to access the file */
25+
content: {
26+
/* Location of file where it is hosted */
27+
location: {
28+
url: "https://documentcloud.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf",
29+
/*
30+
If the file URL requires some additional headers, then it can be passed as follows:-
31+
headers: [
32+
{
33+
key: "<HEADER_KEY>",
34+
value: "<HEADER_VALUE>",
35+
}
36+
]
37+
*/
38+
},
39+
},
40+
/* Pass meta data of file */
41+
metaData: {
42+
/* file name */
43+
fileName: "Bodea Brochure.pdf"
44+
}
45+
}, {});
46+
47+
/* Register the callback to receive the events */
48+
adobeDCView.registerCallback(
49+
/* Type of call back */
50+
AdobeDC.View.Enum.CallbackType.EVENT_LISTENER,
51+
/* call back function */
52+
function(event) {
53+
console.log(event);
54+
},
55+
/* options to control the callback execution */
56+
{
57+
/* Enable PDF analytics events on user interaction. */
58+
enablePDFAnalytics: true,
59+
}
60+
);
61+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# PDF Preview with Annotation tools Sample
2+
3+
PDF Viewer will render PDF file along with annotation tools enabled.
4+
To see it in action, copy the files in the folder to your computer, and open index.html in a supported browser.
5+
6+
**Note**: Annotation tools are currently not supported in any mobile browser, although it is supported for tablet and iPad.
7+
8+
## Documentation
9+
10+
For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs.

0 commit comments

Comments
 (0)