├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── AUTHORS ├── CODE_OF_CONDUCT.md ├── Full Window Embed Mode ├── README.md ├── index.html └── index.js ├── In-Line Embed Mode ├── README.md ├── index.html └── index.js ├── LICENSE.md ├── Lightbox Embed Mode ├── README.md ├── index.html └── index.js ├── More Samples ├── Analytics │ ├── Adobe Analytics │ │ ├── README.md │ │ ├── index.html │ │ └── index.js │ ├── Google Analytics │ │ ├── README.md │ │ ├── index.html │ │ └── index.js │ └── README.md ├── Angular Samples │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ └── samples │ │ │ │ ├── capture-view-sdk-events │ │ │ │ ├── capture-view-sdk-events.component.html │ │ │ │ └── capture-view-sdk-events.component.ts │ │ │ │ ├── embed-modes │ │ │ │ ├── full-window │ │ │ │ │ ├── full-window.component.html │ │ │ │ │ └── full-window.component.ts │ │ │ │ ├── in-line │ │ │ │ │ ├── in-line.component.css │ │ │ │ │ ├── in-line.component.html │ │ │ │ │ └── in-line.component.ts │ │ │ │ ├── lightbox │ │ │ │ │ ├── lightbox.component.css │ │ │ │ │ ├── lightbox.component.html │ │ │ │ │ └── lightbox.component.ts │ │ │ │ └── sized-container │ │ │ │ │ ├── sized-container.component.css │ │ │ │ │ ├── sized-container.component.html │ │ │ │ │ └── sized-container.component.ts │ │ │ │ ├── local-pdf-file-preview │ │ │ │ ├── local-pdf-file-preview.component.css │ │ │ │ ├── local-pdf-file-preview.component.html │ │ │ │ └── local-pdf-file-preview.component.ts │ │ │ │ ├── pdf-annotation-apis │ │ │ │ ├── capture-events │ │ │ │ │ ├── capture-events.component.html │ │ │ │ │ └── capture-events.component.ts │ │ │ │ ├── crud-apis │ │ │ │ │ ├── crud-apis.component.html │ │ │ │ │ └── crud-apis.component.ts │ │ │ │ ├── handling-in-pdf │ │ │ │ │ ├── handling-in-pdf.component.html │ │ │ │ │ └── handling-in-pdf.component.ts │ │ │ │ ├── sample-annotation-list.ts │ │ │ │ └── ui-configurations │ │ │ │ │ ├── custom-rhp │ │ │ │ │ ├── custom-rhp.component.html │ │ │ │ │ ├── custom-rhp.component.ts │ │ │ │ │ └── list-item │ │ │ │ │ │ ├── list-item.component.html │ │ │ │ │ │ └── list-item.component.ts │ │ │ │ │ ├── ui-configurations.component.css │ │ │ │ │ ├── ui-configurations.component.html │ │ │ │ │ └── ui-configurations.component.ts │ │ │ │ ├── pdf-annotation-tools │ │ │ │ ├── pdf-annotation-tools.component.html │ │ │ │ └── pdf-annotation-tools.component.ts │ │ │ │ ├── view-sdk.service.ts │ │ │ │ └── viewer-customization │ │ │ │ ├── viewer-customization.component.html │ │ │ │ └── viewer-customization.component.ts │ │ ├── index.html │ │ ├── main.ts │ │ └── polyfills.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tslint.json ├── Capture PDF Embed API Events │ ├── README.md │ ├── index.html │ └── index.js ├── Handle Search Engine Indexing │ ├── Auto-click PDF Link │ │ ├── README.md │ │ ├── index.html │ │ └── index.js │ ├── Full Window │ │ ├── README.md │ │ ├── index.html │ │ ├── viewer.html │ │ └── viewer.js │ ├── In Line PDF │ │ ├── README.md │ │ ├── index.html │ │ └── index.js │ ├── Lightbox Embed Mode │ │ ├── README.md │ │ ├── index.html │ │ └── index.js │ └── README.md ├── Linearization │ ├── Bodea Brochure - Linearized.pdf │ ├── README.md │ ├── index.html │ └── index.js ├── PDF Annotations APIs │ ├── Annotation Data Samples │ │ ├── README.md │ │ ├── freetext.json │ │ ├── highlight.json │ │ ├── note.json │ │ ├── reply.json │ │ ├── shape.json │ │ ├── strikeout.json │ │ └── underline.json │ ├── CRUD APIs │ │ ├── README.md │ │ ├── index.html │ │ └── index.js │ ├── Capture Events │ │ ├── README.md │ │ ├── index.html │ │ └── index.js │ ├── Handling of Annotations in PDF │ │ ├── README.md │ │ ├── index.html │ │ └── index.js │ ├── README.md │ ├── UI Configurations │ │ ├── README.md │ │ ├── images │ │ │ ├── tool_add_text.svg │ │ │ ├── tool_drawing.svg │ │ │ ├── tool_eraser.svg │ │ │ ├── tool_highlight.svg │ │ │ ├── tool_stickynote.svg │ │ │ ├── tool_strikethrough.svg │ │ │ └── tool_underline.svg │ │ ├── index.html │ │ ├── index.js │ │ └── style.css │ └── annotationList.js ├── PDF Annotations │ ├── README.md │ ├── index.html │ └── index.js ├── React Samples │ ├── .gitignore │ ├── .npmrc │ ├── README.md │ ├── package.json │ ├── public │ │ └── index.html │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── index.js │ │ └── samples │ │ ├── CaptureViewSDKEvents.js │ │ ├── Embed Modes │ │ ├── FullWindow.js │ │ ├── InLine.js │ │ ├── Lightbox.js │ │ └── SizedContainer.js │ │ ├── LocalPDFFilePreview.js │ │ ├── PDF Annotation APIs │ │ ├── CRUDAPIs.js │ │ ├── CaptureEvents.js │ │ ├── HandlingAnnotationsInPDF.js │ │ ├── Sample Annotation List │ │ │ └── annotationList.js │ │ └── UIConfigurations │ │ │ ├── CustomRHP.js │ │ │ ├── CustomUI.css │ │ │ └── UIConfigurations.js │ │ ├── PDFAnnotationTools.js │ │ ├── ViewSDKClient.js │ │ └── ViewerCustomization.js ├── Save User Preferences │ ├── README.md │ ├── index.html │ └── index.js ├── Viewer APIs │ ├── Attachment APIs │ │ ├── README.md │ │ ├── index.html │ │ ├── index.js │ │ └── style.css │ ├── Bookmark APIs │ │ ├── README.md │ │ ├── index.html │ │ ├── index.js │ │ └── style.css │ ├── README.md │ └── Search and Zoom APIs │ │ ├── README.md │ │ ├── images │ │ ├── chevronnext.svg │ │ ├── chevronprevious.svg │ │ ├── zoom_in.svg │ │ └── zoom_out.svg │ │ ├── index.html │ │ ├── index.js │ │ └── style.css ├── Viewer Customization │ ├── README.md │ ├── index.html │ └── index.js └── Work with Local File │ ├── README.md │ ├── index.html │ └── index.js ├── README.md └── Sized Container Embed Mode ├── README.md ├── index.html └── index.js /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for choosing to contribute! 4 | 5 | The following are a set of guidelines to follow when contributing to this project. 6 | 7 | ## Code Of Conduct 8 | 9 | This project adheres to the Adobe [code of conduct](../CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [Grp-opensourceoffice@adobe.com](mailto:Grp-opensourceoffice@adobe.com). 10 | 11 | ## Contributor License Agreement 12 | 13 | All third-party contributions to this project must be accompanied by a signed contributor license. This gives Adobe permission to redistribute your contributions as part of the project. Sign our [CLA](http://adobe.github.io/cla.html). You only need to submit an Adobe CLA one time, so if you have submitted one previously, you are good to go! 14 | 15 | ## Code Reviews 16 | 17 | All submissions should come in the form of pull requests and need to be reviewed by project committers. Read [GitHub's pull request documentation](https://help.github.com/articles/about-pull-requests/) for more information on sending pull requests. 18 | 19 | Lastly, please follow the [pull request template](PULL_REQUEST_TEMPLATE.md) when submitting a pull request! 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ### Expected Behaviour 5 | 6 | ### Actual Behaviour 7 | 8 | ### Reproduce Scenario (including but not limited to) 9 | 10 | #### Steps to Reproduce 11 | 12 | #### Platform and Version 13 | 14 | #### Sample Code that illustrates the problem 15 | 16 | #### Logs taken while reproducing problem 17 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Description 4 | 5 | 6 | 7 | ## Related Issue 8 | 9 | 10 | 11 | 12 | 13 | 14 | ## Motivation and Context 15 | 16 | 17 | 18 | ## How Has This Been Tested? 19 | 20 | 21 | 22 | 23 | 24 | ## Screenshots (if appropriate): 25 | 26 | ## Types of changes 27 | 28 | 29 | 30 | - [ ] Bug fix (non-breaking change which fixes an issue) 31 | - [ ] New feature (non-breaking change which adds functionality) 32 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 33 | 34 | ## Checklist: 35 | 36 | 37 | 38 | 39 | - [ ] I have signed the [Adobe Open Source CLA](http://opensource.adobe.com/cla.html). 40 | - [ ] My code follows the code style of this project. 41 | - [ ] My change requires a change to the documentation. 42 | - [ ] I have updated the documentation accordingly. 43 | - [ ] I have read the **CONTRIBUTING** document. 44 | - [ ] I have added tests to cover my changes. 45 | - [ ] All new and existing tests passed. 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Authors ordered by first contribution 2 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Adobe Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at Grp-opensourceoffice@adobe.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [http://contributor-covenant.org/version/1/4][version] 72 | 73 | [homepage]: http://contributor-covenant.org 74 | [version]: http://contributor-covenant.org/version/1/4/ 75 | -------------------------------------------------------------------------------- /Full Window Embed Mode/README.md: -------------------------------------------------------------------------------- 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. 9 | -------------------------------------------------------------------------------- /Full Window Embed Mode/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Full Window Embed Mode/index.js: -------------------------------------------------------------------------------- 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 | /* Control the default view mode */ 13 | const viewerConfig = { 14 | /* Allowed possible values are "FIT_PAGE", "FIT_WIDTH", "TWO_COLUMN", "TWO_COLUMN_FIT_PAGE" or "". */ 15 | defaultViewMode: "", 16 | }; 17 | 18 | /* Wait for Adobe Acrobat Services PDF Embed API to be ready */ 19 | document.addEventListener("adobe_dc_view_sdk.ready", function () { 20 | /* Initialize the AdobeDC View object */ 21 | var adobeDCView = new AdobeDC.View({ 22 | /* Pass your registered client id */ 23 | clientId: "", 24 | /* Pass the div id in which PDF should be rendered */ 25 | divId: "adobe-dc-view", 26 | }); 27 | 28 | /* Invoke the file preview API on Adobe DC View object */ 29 | adobeDCView.previewFile({ 30 | /* Pass information on how to access the file */ 31 | content: { 32 | /* Location of file where it is hosted */ 33 | location: { 34 | url: "https://acrobatservices.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf", 35 | /* 36 | If the file URL requires some additional headers, then it can be passed as follows:- 37 | headers: [ 38 | { 39 | key: "", 40 | value: "", 41 | } 42 | ] 43 | */ 44 | }, 45 | }, 46 | /* Pass meta data of file */ 47 | metaData: { 48 | /* file name */ 49 | fileName: "Bodea Brochure.pdf" 50 | } 51 | }, viewerConfig); 52 | }); 53 | -------------------------------------------------------------------------------- /In-Line Embed Mode/README.md: -------------------------------------------------------------------------------- 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. 9 | -------------------------------------------------------------------------------- /In-Line Embed Mode/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /In-Line Embed Mode/index.js: -------------------------------------------------------------------------------- 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 Acrobat Services PDF Embed API 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: "", 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://acrobatservices.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: "", 39 | 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 | }); 52 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | © Copyright 2019 Adobe. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Lightbox Embed Mode/README.md: -------------------------------------------------------------------------------- 1 | # Lightbox Embed Mode Sample 2 | 3 | PDF viewer is displayed on top of web page and fills the entire browser window to provide a focused view. Best suited for content websites, content portals and email. 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. 9 | -------------------------------------------------------------------------------- /Lightbox Embed Mode/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Lightbox Embed Mode/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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: "LIGHT_BOX" 15 | }; 16 | 17 | /* Wait for Adobe Acrobat Services PDF Embed API to be ready and enable the View PDF button */ 18 | document.addEventListener("adobe_dc_view_sdk.ready", function () { 19 | document.getElementById("view-pdf-btn").disabled = false; 20 | }); 21 | 22 | /* Function to render the file using PDF Embed API. */ 23 | function previewFile() 24 | { 25 | /* Initialize the AdobeDC View object */ 26 | var adobeDCView = new AdobeDC.View({ 27 | /* Pass your registered client id */ 28 | clientId: "" 29 | }); 30 | 31 | /* Invoke the file preview API on Adobe DC View object */ 32 | adobeDCView.previewFile({ 33 | /* Pass information on how to access the file */ 34 | content: { 35 | /* Location of file where it is hosted */ 36 | location: { 37 | url: "https://acrobatservices.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf", 38 | /* 39 | If the file URL requires some additional headers, then it can be passed as follows:- 40 | header: [ 41 | { 42 | key: "", 43 | value: "", 44 | } 45 | ] 46 | */ 47 | }, 48 | }, 49 | /* Pass meta data of file */ 50 | metaData: { 51 | /* file name */ 52 | fileName: "Bodea Brochure.pdf" 53 | } 54 | }, viewerConfig); 55 | }; 56 | -------------------------------------------------------------------------------- /More Samples/Analytics/Adobe Analytics/README.md: -------------------------------------------------------------------------------- 1 | # Sample for Adobe Analytics 2 | 3 | This sample shows how to set up the PDF viewer to send analytics from PDF Embed API to Adobe Analytics. 4 | 5 | To see it in action, copy the files in the folder to your computer, and open index.html in a supported browser. 6 | 7 | ## Documentation 8 | 9 | To know more about the setup steps, please check the [documentation](https://developer.adobe.com/document-services/docs/overview/pdf-embed-api/howtodata/). -------------------------------------------------------------------------------- /More Samples/Analytics/Adobe Analytics/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /More Samples/Analytics/Adobe Analytics/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 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 viewer customization options here. */ 13 | const viewerConfig = { 14 | showPrintPDF: true, 15 | showDownloadPDF: true, 16 | defaultViewMode: "", /* Allowed possible values are "FIT_PAGE", "FIT_WIDTH", "TWO_COLUMN", "TWO_COLUMN_FIT_PAGE" or "". */ 17 | embedMode: "FULL_WINDOW" /* Pass the embed mode here. */ 18 | }; 19 | 20 | /* Wait for Adobe Acrobat Services PDF Embed API to be ready */ 21 | document.addEventListener("adobe_dc_view_sdk.ready", function () { 22 | /* Initialize the AdobeDC View object */ 23 | var adobeDCView = new AdobeDC.View({ 24 | /* Pass your registered client id */ 25 | clientId: "", 26 | /* Pass the div id in which PDF should be rendered */ 27 | divId: "adobe-dc-view", 28 | /* Pass the Adobe Analytics report suite ID. */ 29 | reportSuiteId: "" 30 | }); 31 | 32 | /* Invoke the file preview API on Adobe DC View object */ 33 | adobeDCView.previewFile({ 34 | /* Pass information on how to access the file */ 35 | content: { 36 | /* Location of file where it is hosted */ 37 | location: { 38 | url: "https://acrobatservices.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf", 39 | /* 40 | If the file URL requires some additional headers, then it can be passed as follows:- 41 | header: [ 42 | { 43 | key: "", 44 | value: "", 45 | } 46 | ] 47 | */ 48 | }, 49 | }, 50 | /* Pass meta data of file */ 51 | metaData: { 52 | /* file name */ 53 | fileName: "Bodea Brochure.pdf" 54 | } 55 | }, viewerConfig); 56 | }); 57 | -------------------------------------------------------------------------------- /More Samples/Analytics/Google Analytics/README.md: -------------------------------------------------------------------------------- 1 | # Sample for Google Analytics 2 | 3 | This sample shows how to set up the PDF viewer to send analytics from PDF Embed API to Google Analytics. 4 | 5 | To see it in action, copy the files in the folder to your computer, and open index.html in a supported browser. 6 | 7 | ## Documentation 8 | 9 | To know more about the setup steps, please check the [documentation](https://developer.adobe.com/document-services/docs/overview/pdf-embed-api/howtodata/). -------------------------------------------------------------------------------- /More Samples/Analytics/Google Analytics/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | Adobe Acrobat Services PDF Embed API Sample 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /More Samples/Analytics/Google Analytics/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 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 viewer customization options here. */ 13 | const viewerConfig = { 14 | showPrintPDF: true, 15 | showDownloadPDF: true, 16 | defaultViewMode: "", /* Allowed possible values are "FIT_PAGE", "FIT_WIDTH", "TWO_COLUMN", "TWO_COLUMN_FIT_PAGE" or "". */ 17 | embedMode: "FULL_WINDOW" /* Pass the embed mode here. */ 18 | }; 19 | 20 | /* Wait for Adobe Acrobat Services PDF Embed API to be ready */ 21 | document.addEventListener("adobe_dc_view_sdk.ready", function () { 22 | /* Initialize the AdobeDC View object */ 23 | var adobeDCView = new AdobeDC.View({ 24 | /* Pass your registered client id */ 25 | clientId: "", 26 | /* Pass the div id in which PDF should be rendered */ 27 | divId: "adobe-dc-view", 28 | /* Pass the measurement ID corresponding to the Google Analytics 4 property. */ 29 | measurementId : "", 30 | }); 31 | 32 | /* Invoke the file preview API on Adobe DC View object */ 33 | adobeDCView.previewFile({ 34 | /* Pass information on how to access the file */ 35 | content: { 36 | /* Location of file where it is hosted */ 37 | location: { 38 | url: "https://acrobatservices.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf", 39 | /* 40 | If the file URL requires some additional headers, then it can be passed as follows:- 41 | header: [ 42 | { 43 | key: "", 44 | value: "", 45 | } 46 | ] 47 | */ 48 | }, 49 | }, 50 | /* Pass meta data of file */ 51 | metaData: { 52 | /* file name */ 53 | fileName: "Bodea Brochure.pdf" 54 | } 55 | }, viewerConfig); 56 | }); 57 | -------------------------------------------------------------------------------- /More Samples/Analytics/README.md: -------------------------------------------------------------------------------- 1 | # Analytics 2 | 3 | If a website is already integrated with analytics tools, such as, Adobe Analytics or Google Analytics, then PDF analytics can be collected in these tools. These samples demonstrate how website developers can collect PDF analytics generated from PDF Embed API in Adobe Analytics and Google Analytics. 4 | 5 | ### Adobe Analytics 6 | 7 | This sample shows how to set up the PDF viewer to send analytics from PDF Embed API to Adobe Analytics. 8 | 9 | To see it in action, copy the files in the folder to your computer, and open index.html in a supported browser. 10 | 11 | ### Google Analytics 12 | 13 | This sample shows how to set up the PDF viewer to send analytics from PDF Embed API to Google Analytics. 14 | 15 | To see it in action, copy the files in the folder to your computer, and open index.html in a supported browser. 16 | 17 | ## Documentation 18 | 19 | To know more about the setup steps, please check the [documentation](https://developer.adobe.com/document-services/docs/overview/pdf-embed-api/howtodata/). -------------------------------------------------------------------------------- /More Samples/Angular Samples/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/README.md: -------------------------------------------------------------------------------- 1 | # Angular Sample 2 | 3 | This is an Angular sample application, demonstrating how to use Adobe Acrobat Services PDF Embed API with Angular. To try it out, clone this folder on your computer and run the following commands: 4 | 5 | ``` 6 | > npm install 7 | > npm start 8 | ``` 9 | 10 | The app will be available at ```http://localhost:4200``` 11 | 12 | Below are the endpoints exposed from the application to show different use cases of PDF embed API. 13 | 14 | For detailed description about each of the samples, see [README](../../README.md). 15 | 16 | | Sample | Endpoint | 17 | |---|---| 18 | |Full Window Embed Mode | ```http://localhost:4200/fullWindow``` | 19 | |Sized Container Embed Mode | ```http://localhost:4200/sizedContainer``` | 20 | |In-Line Embed Mode | ```http://localhost:4200/inLine``` | 21 | |Lightbox Embed Mode | ```http://localhost:4200/lightbox``` | 22 | |PDF Preview with Annotation Tools | ```http://localhost:4200/pdfAnnotationTools``` | 23 | |Viewer Customization | ```http://localhost:4200/viewerCustomization``` | 24 | |Local PDF File Preview | ```http://localhost:4200/localPDFFilePreview``` | 25 | |PDF Preview with Events | ```http://localhost:4200/captureEvents``` | 26 | 27 | 28 | Following endpoints showcase the different PDF Annotation APIs and their use cases. 29 | 30 | For detailed description about the annotation APIs samples, see [Annotation APIs README](../PDF%20Annotations%20APIs/README.md). 31 | 32 | | Annotation API Sample | Endpoint | 33 | |---|---| 34 | |CRUD APIs | ```http://localhost:4200/annotationAPIs``` | 35 | |Handling of Annotations in PDF | ```http://localhost:4200/annotationAPIs/handlingInPDF``` | 36 | |Capture Events | ```http://localhost:4200/annotationAPIs/captureEvents``` | 37 | |UI Configurations | ```http://localhost:4200/annotationAPIs/UIConfigurations``` | 38 | 39 | 40 | **Note**: Node version >=10.13.0 is required to run this sample. 41 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "adobe-dc-view-sdk-angular-sample": { 7 | "projectType": "application", 8 | "schematics": {}, 9 | "root": "", 10 | "sourceRoot": "src", 11 | "prefix": "app", 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist/adobe-dc-view-sdk-angular-sample", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "tsconfig.app.json", 21 | "aot": true, 22 | "scripts": [] 23 | } 24 | }, 25 | "serve": { 26 | "builder": "@angular-devkit/build-angular:dev-server", 27 | "options": { 28 | "browserTarget": "adobe-dc-view-sdk-angular-sample:build" 29 | } 30 | }, 31 | "extract-i18n": { 32 | "builder": "@angular-devkit/build-angular:extract-i18n", 33 | "options": { 34 | "browserTarget": "adobe-dc-view-sdk-angular-sample:build" 35 | } 36 | }, 37 | "lint": { 38 | "builder": "@angular-devkit/build-angular:tslint", 39 | "options": { 40 | "tsConfig": ["tsconfig.app.json"], 41 | "exclude": ["**/node_modules/**"] 42 | } 43 | } 44 | } 45 | } 46 | }, 47 | "defaultProject": "adobe-dc-view-sdk-angular-sample", 48 | "cli": { 49 | "analytics": false 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "adobe-dc-view-sdk-angular-sample", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "node ./node_modules/@angular/cli/bin/ng serve" 7 | }, 8 | "private": false, 9 | "dependencies": { 10 | "@angular/common": "~14.1.3", 11 | "@angular/compiler": "~14.1.3", 12 | "@angular/core": "~14.1.3", 13 | "@angular/forms": "~14.1.3", 14 | "@angular/platform-browser": "~14.1.3", 15 | "@angular/platform-browser-dynamic": "~14.1.3", 16 | "@angular/router": "~14.1.3", 17 | "tslib": "^2.4.0", 18 | "zone.js": "~0.11.8" 19 | }, 20 | "devDependencies": { 21 | "@angular-devkit/build-angular": "~14.1.3", 22 | "@angular/cli": "~14.1.3", 23 | "@angular/compiler-cli": "~14.1.3", 24 | "@angular/language-service": "~14.1.3", 25 | "@types/node": "^18.7.13", 26 | "codelyzer": "^6.0.2", 27 | "ts-node": "~10.9.1", 28 | "tslint": "~6.1.0", 29 | "typescript": "~4.7.4" 30 | }, 31 | "browserslist": { 32 | "development": [ 33 | "last 2 Chrome versions", 34 | "last 2 Firefox versions", 35 | "last 2 Edge versions", 36 | "last 2 Safari versions" 37 | ] 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { NgModule } from '@angular/core'; 13 | import { Routes, RouterModule } from '@angular/router'; 14 | import { FullWindowComponent } from './samples/embed-modes/full-window/full-window.component'; 15 | import { SizedContainerComponent } from './samples/embed-modes/sized-container/sized-container.component'; 16 | import { InLineComponent } from './samples/embed-modes/in-line/in-line.component'; 17 | import { LightboxComponent } from './samples/embed-modes/lightbox/lightbox.component'; 18 | import { PDFAnnotationToolsComponent } from './samples/pdf-annotation-tools/pdf-annotation-tools.component'; 19 | import { ViewerCustomizationComponent } from './samples/viewer-customization/viewer-customization.component'; 20 | import { CaptureViewSDKEventsComponent } from './samples/capture-view-sdk-events/capture-view-sdk-events.component'; 21 | import { LocalPDFFilePreviewComponent } from './samples/local-pdf-file-preview/local-pdf-file-preview.component'; 22 | import { CaptureEventsComponent } from './samples/pdf-annotation-apis/capture-events/capture-events.component'; 23 | import { CRUDAPIsComponent } from './samples/pdf-annotation-apis/crud-apis/crud-apis.component'; 24 | import { HandlingAnnotationsInPDFComponent } from './samples/pdf-annotation-apis/handling-in-pdf/handling-in-pdf.component'; 25 | import { UIConfigurationsComponent } from './samples/pdf-annotation-apis/ui-configurations/ui-configurations.component'; 26 | 27 | const routes: Routes = [ 28 | { path: '', component: FullWindowComponent }, 29 | { path: 'fullWindow', component: FullWindowComponent }, 30 | { path: 'sizedContainer', component: SizedContainerComponent }, 31 | { path: 'inLine', component: InLineComponent }, 32 | { path: 'lightbox', component: LightboxComponent }, 33 | { path: 'pdfAnnotationTools', component: PDFAnnotationToolsComponent }, 34 | { path: 'viewerCustomization', component: ViewerCustomizationComponent }, 35 | { path: 'captureEvents', component: CaptureViewSDKEventsComponent }, 36 | { path: 'localPDFFilePreview', component: LocalPDFFilePreviewComponent }, 37 | { path: 'annotationAPIs', component: CRUDAPIsComponent }, 38 | { path: 'annotationAPIs/captureEvents', component: CaptureEventsComponent }, 39 | { path: 'annotationAPIs/handlingInPDF', component: HandlingAnnotationsInPDFComponent }, 40 | { path: 'annotationAPIs/UIConfigurations', component: UIConfigurationsComponent }, 41 | ]; 42 | 43 | @NgModule({ 44 | imports: [ 45 | RouterModule.forRoot(routes) 46 | ], 47 | exports: [ 48 | RouterModule 49 | ] 50 | }) 51 | 52 | export class AppRoutingModule { } 53 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | .pdf-view { 13 | height: 100vh; 14 | } 15 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component, ViewEncapsulation } from '@angular/core'; 13 | 14 | @Component({ 15 | selector: 'app-root', 16 | templateUrl: './app.component.html', 17 | styleUrls: ['./app.component.css'], 18 | encapsulation: ViewEncapsulation.None, 19 | }) 20 | export class AppComponent { 21 | title = 'adobe-dc-view-sdk-angular-sample'; 22 | } 23 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { BrowserModule } from '@angular/platform-browser'; 13 | import { NgModule } from '@angular/core'; 14 | import { FormsModule } from '@angular/forms'; 15 | import { AppRoutingModule } from './app-routing.module'; 16 | import { AppComponent } from './app.component'; 17 | import { FullWindowComponent } from './samples/embed-modes/full-window/full-window.component'; 18 | import { SizedContainerComponent } from './samples/embed-modes/sized-container/sized-container.component'; 19 | import { InLineComponent } from './samples/embed-modes/in-line/in-line.component'; 20 | import { LightboxComponent } from './samples/embed-modes/lightbox/lightbox.component'; 21 | import { PDFAnnotationToolsComponent } from './samples/pdf-annotation-tools/pdf-annotation-tools.component'; 22 | import { ViewerCustomizationComponent } from './samples/viewer-customization/viewer-customization.component'; 23 | import { CaptureViewSDKEventsComponent } from './samples/capture-view-sdk-events/capture-view-sdk-events.component'; 24 | import { LocalPDFFilePreviewComponent } from './samples/local-pdf-file-preview/local-pdf-file-preview.component'; 25 | import { CRUDAPIsComponent } from './samples/pdf-annotation-apis/crud-apis/crud-apis.component'; 26 | import { CaptureEventsComponent } from './samples/pdf-annotation-apis/capture-events/capture-events.component'; 27 | import { HandlingAnnotationsInPDFComponent } from './samples/pdf-annotation-apis/handling-in-pdf/handling-in-pdf.component'; 28 | import { UIConfigurationsComponent } from './samples/pdf-annotation-apis/ui-configurations/ui-configurations.component'; 29 | import { CustomRHPComponent } from './samples/pdf-annotation-apis/ui-configurations/custom-rhp/custom-rhp.component'; 30 | import { ListItemComponent } from './samples/pdf-annotation-apis/ui-configurations/custom-rhp/list-item/list-item.component'; 31 | 32 | @NgModule({ 33 | declarations: [ 34 | AppComponent, 35 | FullWindowComponent, 36 | SizedContainerComponent, 37 | InLineComponent, 38 | LightboxComponent, 39 | PDFAnnotationToolsComponent, 40 | ViewerCustomizationComponent, 41 | CaptureViewSDKEventsComponent, 42 | LocalPDFFilePreviewComponent, 43 | CRUDAPIsComponent, 44 | CaptureEventsComponent, 45 | HandlingAnnotationsInPDFComponent, 46 | UIConfigurationsComponent, 47 | CustomRHPComponent, 48 | ListItemComponent 49 | ], 50 | imports: [ 51 | BrowserModule, 52 | AppRoutingModule, 53 | FormsModule 54 | ], 55 | bootstrap: [ 56 | AppComponent 57 | ] 58 | }) 59 | 60 | export class AppModule { } 61 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/capture-view-sdk-events/capture-view-sdk-events.component.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/capture-view-sdk-events/capture-view-sdk-events.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component, AfterViewInit } from '@angular/core'; 13 | import { ViewSDKClient } from '../view-sdk.service'; 14 | 15 | @Component({ 16 | templateUrl: './capture-view-sdk-events.component.html' 17 | }) 18 | export class CaptureViewSDKEventsComponent implements AfterViewInit { 19 | constructor(private viewSDKClient: ViewSDKClient) { } 20 | 21 | ngAfterViewInit() { 22 | this.viewSDKClient.ready().then(() => { 23 | /* Invoke file preview */ 24 | this.viewSDKClient.previewFile('pdf-div', {}); 25 | /* Register the callback to receive the events */ 26 | this.viewSDKClient.registerEventsHandler(); 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/embed-modes/full-window/full-window.component.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/embed-modes/full-window/full-window.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component, AfterViewInit} from '@angular/core'; 13 | import { ViewSDKClient } from '../../view-sdk.service'; 14 | 15 | @Component({ 16 | templateUrl: './full-window.component.html' 17 | }) 18 | export class FullWindowComponent implements AfterViewInit { 19 | constructor(private viewSDKClient: ViewSDKClient) { } 20 | 21 | ngAfterViewInit() { 22 | this.viewSDKClient.ready().then(() => { 23 | /* Invoke file preview */ 24 | /* By default the embed mode will be Full Window */ 25 | this.viewSDKClient.previewFile('pdf-div', {}); 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/embed-modes/in-line/in-line.component.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | .pdf-view { 13 | display: inline-block; 14 | margin: 10% 0 10% 0; 15 | width: 800px; 16 | box-shadow: 1px 1px 10px 1px #dadada; 17 | } 18 | 19 | .container { 20 | text-align: center; 21 | } 22 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/embed-modes/in-line/in-line.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/embed-modes/in-line/in-line.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component, AfterViewInit } from '@angular/core'; 13 | import { ViewSDKClient } from '../../view-sdk.service'; 14 | 15 | @Component({ 16 | templateUrl: './in-line.component.html', 17 | styleUrls: ['./in-line.component.css'] 18 | }) 19 | export class InLineComponent implements AfterViewInit { 20 | constructor(private viewSDKClient: ViewSDKClient) { } 21 | 22 | ngAfterViewInit() { 23 | this.viewSDKClient.ready().then(() => { 24 | /* Invoke file preview */ 25 | this.viewSDKClient.previewFile('pdf-div', { 26 | /* Pass the embed mode option here */ 27 | embedMode: 'IN_LINE' 28 | }); 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/embed-modes/lightbox/lightbox.component.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | .container { 13 | background-color: #fdfdf9; 14 | height: 100vh; 15 | } 16 | 17 | .lb-view-file-btn { 18 | background-color: #1473e6; 19 | border: 1px #404040; 20 | border-radius: 5px; 21 | color: #ededed; 22 | cursor: pointer; 23 | font-family: "Arial"; 24 | font-size: 15px; 25 | margin: 100px 0 0 80px; 26 | padding: 10px; 27 | width: 120px; 28 | } 29 | 30 | .lb-view-file-btn:hover { 31 | background-color: #0969df; 32 | color: white; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/embed-modes/lightbox/lightbox.component.html: -------------------------------------------------------------------------------- 1 |
2 | 5 |
6 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/embed-modes/lightbox/lightbox.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component } from '@angular/core'; 13 | import { ViewSDKClient } from '../../view-sdk.service'; 14 | 15 | @Component({ 16 | templateUrl: './lightbox.component.html', 17 | styleUrls: ['./lightbox.component.css'] 18 | }) 19 | export class LightboxComponent { 20 | constructor(private viewSDKClient: ViewSDKClient) { } 21 | 22 | previewFile() { 23 | this.viewSDKClient.ready().then(() => { 24 | /* Invoke file preview */ 25 | this.viewSDKClient.previewFile('', { 26 | /* Pass the embed mode option here */ 27 | embedMode: 'LIGHT_BOX' 28 | }); 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/embed-modes/sized-container/sized-container.component.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | .pdf-view { 13 | margin: auto; 14 | margin-top: 5%; 15 | height: 476px; 16 | width: 600px; 17 | border: 1px solid #dadada; 18 | } 19 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/embed-modes/sized-container/sized-container.component.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/embed-modes/sized-container/sized-container.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component, AfterViewInit } from '@angular/core'; 13 | import { ViewSDKClient } from '../../view-sdk.service'; 14 | 15 | @Component({ 16 | templateUrl: './sized-container.component.html', 17 | styleUrls: ['./sized-container.component.css'] 18 | }) 19 | export class SizedContainerComponent implements AfterViewInit { 20 | constructor(private viewSDKClient: ViewSDKClient) { } 21 | 22 | ngAfterViewInit() { 23 | this.viewSDKClient.ready().then(() => { 24 | /* Invoke file preview */ 25 | this.viewSDKClient.previewFile('pdf-div', { 26 | /* Pass the embed mode option here */ 27 | embedMode: 'SIZED_CONTAINER' 28 | }); 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/local-pdf-file-preview/local-pdf-file-preview.component.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | .file-input { 13 | display: none; 14 | } 15 | 16 | .file-picker { 17 | font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif; 18 | padding: 10px; 19 | border-radius: 5px; 20 | border: 1px #404040; 21 | cursor: pointer; 22 | color: #ededed; 23 | display: inline-block; 24 | background-color: #404040; 25 | box-shadow: 12px 5px 30px -12px rgba(0, 0, 0, 0.58); 26 | } 27 | 28 | .file-picker:hover { 29 | color: white; 30 | background-color: #252525; 31 | } 32 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/local-pdf-file-preview/local-pdf-file-preview.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 | 6 |
7 |
8 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/local-pdf-file-preview/local-pdf-file-preview.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component } from '@angular/core'; 13 | import { ViewSDKClient } from '../view-sdk.service'; 14 | 15 | @Component({ 16 | templateUrl: './local-pdf-file-preview.component.html', 17 | styleUrls: ['./local-pdf-file-preview.component.css'] 18 | }) 19 | export class LocalPDFFilePreviewComponent { 20 | constructor(private viewSDKClient: ViewSDKClient) { } 21 | 22 | // Helper function to check if selected file is PDF or not. 23 | isValidPDF(file: File) { 24 | if (file.type === 'application/pdf') { 25 | return true; 26 | } 27 | if (file.type === '' && file.name) { 28 | const fileName = file.name; 29 | const lastDotIndex = fileName.lastIndexOf('.'); 30 | if (lastDotIndex === -1 || fileName.substr(lastDotIndex).toUpperCase() !== 'PDF') { 31 | return false; 32 | } 33 | return true; 34 | } 35 | return false; 36 | } 37 | 38 | /* Helper function to be executed on file upload 39 | * for creating Promise which resolve to ArrayBuffer of file data. 40 | **/ 41 | onFileUpload(files: File[]) { 42 | this.viewSDKClient.ready().then(() => { 43 | if (files.length > 0 && this.isValidPDF(files[0])) { 44 | const fileName = files[0].name; 45 | const reader = new FileReader(); 46 | reader.onloadend = e => { 47 | const filePromise = Promise.resolve(e.target.result); 48 | /* Helper function to render the file using PDF Embed API. */ 49 | this.viewSDKClient.previewFileUsingFilePromise('pdf-div', filePromise, fileName); 50 | }; 51 | reader.readAsArrayBuffer(files[0]); 52 | } 53 | }); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-apis/capture-events/capture-events.component.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-apis/capture-events/capture-events.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component, AfterViewInit } from '@angular/core'; 13 | import { ViewSDKClient } from '../../view-sdk.service'; 14 | import { annotations } from '../sample-annotation-list'; 15 | 16 | @Component({ 17 | templateUrl: './capture-events.component.html', 18 | }) 19 | export class CaptureEventsComponent implements AfterViewInit { 20 | previewFilePromise: any; 21 | 22 | viewerConfig = { 23 | /* Enable commenting APIs */ 24 | enableAnnotationAPIs: true, /* Default value is false */ 25 | }; 26 | 27 | constructor(private viewSDKClient: ViewSDKClient) { } 28 | 29 | ngAfterViewInit() { 30 | this.viewSDKClient.ready().then(() => { 31 | /* Invoke the file preview and get the Promise object */ 32 | this.previewFilePromise = this.viewSDKClient.previewFile('pdf-div', this.viewerConfig); 33 | /* Use the annotation manager interface to invoke the commenting APIs */ 34 | this.previewFilePromise.then((adobeViewer: any) => { 35 | adobeViewer.getAnnotationManager().then((annotationManager: any) => { 36 | /* API to add annotations */ 37 | annotationManager.addAnnotations(annotations) 38 | .then(() => { 39 | console.log('Annotations added through API successfully'); 40 | }) 41 | .catch((error: any) => { 42 | console.log(error); 43 | }); 44 | 45 | /* API to register events listener */ 46 | annotationManager.registerEventListener( 47 | (event: any) => { 48 | console.log(event); 49 | }, 50 | { 51 | /* Pass the list of events in listenOn. */ 52 | /* If no event is passed in listenOn, then all the annotation events will be received. */ 53 | listenOn: [ 54 | /* 'ANNOTATION_ADDED', 'ANNOTATION_CLICKED' */ 55 | ] 56 | } 57 | ); 58 | }); 59 | }); 60 | }); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-apis/crud-apis/crud-apis.component.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-apis/handling-in-pdf/handling-in-pdf.component.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-apis/handling-in-pdf/handling-in-pdf.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component, AfterViewInit } from '@angular/core'; 13 | import { ViewSDKClient } from '../../view-sdk.service'; 14 | import { annotations } from '../sample-annotation-list'; 15 | 16 | @Component({ 17 | templateUrl: './handling-in-pdf.component.html', 18 | }) 19 | export class HandlingAnnotationsInPDFComponent implements AfterViewInit { 20 | previewFilePromise: any; 21 | 22 | viewerConfig = { 23 | /* Enable commenting APIs */ 24 | enableAnnotationAPIs: true, /* Default value is false */ 25 | /* Include existing PDF annotations and save new annotations to PDF buffer */ 26 | includePDFAnnotations: true /* Default value is false */ 27 | }; 28 | 29 | constructor(private viewSDKClient: ViewSDKClient) { } 30 | 31 | ngAfterViewInit() { 32 | this.viewSDKClient.ready().then(() => { 33 | /* Invoke the file preview and get the Promise object */ 34 | this.previewFilePromise = this.viewSDKClient.previewFile('pdf-div', this.viewerConfig); 35 | /* Use the annotation manager interface to invoke the commenting APIs */ 36 | this.previewFilePromise.then((adobeViewer: any) => { 37 | adobeViewer.getAnnotationManager().then((annotationManager: any) => { 38 | /* API to add annotations to PDF and return the updated PDF buffer */ 39 | /* These APIs will work only when includePDFAnnotations is set to true in viewerConfig */ 40 | annotationManager.addAnnotationsInPDF(annotations) 41 | .then((result: any) => { 42 | console.log('Annotations added to PDF successfully and updated PDF buffer returned.', result); 43 | }) 44 | .catch((error: any) => { 45 | console.log(error); 46 | }); 47 | 48 | /* API to remove annotations from PDF and return the updated PDF buffer along with the list of annotations */ 49 | setTimeout(() => { 50 | annotationManager.removeAnnotationsFromPDF() 51 | .then((result: any) => { 52 | console.log( 53 | 'Annotations removed from PDF successfully and updated PDF bufferand annotation list returned.' 54 | , result 55 | ); 56 | }) 57 | .catch((error: any) => { 58 | console.log(error); 59 | }); 60 | }, 3000); 61 | }); 62 | }); 63 | }); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-apis/ui-configurations/custom-rhp/custom-rhp.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Annotations

3 |
    4 | 8 | 9 |
10 |
11 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-apis/ui-configurations/custom-rhp/custom-rhp.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component, AfterViewInit, Input } from '@angular/core'; 13 | 14 | @Component({ 15 | selector: 'custom-rhp-component', 16 | templateUrl: './custom-rhp.component.html' 17 | }) 18 | export class CustomRHPComponent implements AfterViewInit { 19 | @Input() annotationManager: any; 20 | 21 | annotationListItems: any[] = []; 22 | selectedAnnotationId: string; 23 | 24 | annotationEventListener = (event: any) => { 25 | if (event.type === 'ANNOTATION_ADDED') { 26 | if (event.data.bodyValue) { 27 | this.onAnnotationAdded(event.data); 28 | } else { 29 | this.addCommentText(event.data); 30 | } 31 | } 32 | if (event.type === 'ANNOTATION_DELETED') { 33 | this.onAnnotationDeleted(event.data.id); 34 | } 35 | if (event.type === 'ANNOTATION_SELECTED') { 36 | this.toggleSelectedAnnotation(event.data.id); 37 | } 38 | if (event.type === 'ANNOTATION_UNSELECTED') { 39 | this.toggleSelectedAnnotation(undefined); 40 | } 41 | if (event.type === "ANNOTATION_UPDATED" && event.data.target.selector.subtype === "freetext") { 42 | this.onTextAnnotationUpdated(event.data); 43 | } 44 | console.log(event); 45 | } 46 | 47 | /* This will add a new annotation list item */ 48 | onAnnotationAdded = (annotation: any) => { 49 | this.annotationListItems.push(annotation); 50 | }; 51 | 52 | /* This will delete the annotation list item */ 53 | onAnnotationDeleted = (id: any) => { 54 | this.annotationListItems = this.annotationListItems.filter(item => item.id !== id); 55 | } 56 | 57 | /* This will set/unset selected annotation id */ 58 | toggleSelectedAnnotation = (id: string) => { 59 | this.selectedAnnotationId = id; 60 | } 61 | 62 | /* This will update the text in the annotation list item when text annotation is updated from UI */ 63 | onTextAnnotationUpdated = (annotation: any) => { 64 | var index = this.annotationListItems.findIndex(item => item.id === annotation.id); 65 | this.annotationListItems[index].bodyValue = annotation.bodyValue; 66 | } 67 | 68 | addCommentText = (annotation: any) => { 69 | const type = annotation.target.selector.subtype; 70 | const comment = prompt('Enter the text associated with ' + type, 'Added a ' + type) || 'Added a ' + type; 71 | annotation.bodyValue = comment; 72 | this.annotationManager.updateAnnotation(annotation) 73 | .then(() => { 74 | console.log('Annotation updated successfully.'); 75 | this.onAnnotationAdded(annotation); 76 | }) 77 | .catch((error: any) => { 78 | console.log(error); 79 | }); 80 | } 81 | 82 | ngAfterViewInit() { 83 | /* API to register events listener */ 84 | this.annotationManager.registerEventListener(this.annotationEventListener); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-apis/ui-configurations/custom-rhp/list-item/list-item.component.html: -------------------------------------------------------------------------------- 1 |
  • 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
  • 16 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-apis/ui-configurations/custom-rhp/list-item/list-item.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component, Input, AfterViewInit } from '@angular/core'; 13 | 14 | @Component({ 15 | selector: 'list-item-component', 16 | templateUrl: './list-item.component.html' 17 | }) 18 | export class ListItemComponent implements AfterViewInit { 19 | @Input() annotation: any; 20 | @Input() selectedAnnotationId: string; 21 | @Input() annotationManager: any; 22 | 23 | inEditMode = false; 24 | editInputValue: any = undefined; 25 | 26 | /* Bind editAnnotation to edit button. */ 27 | editButtonOnClick = (e: any) => { 28 | e.stopPropagation(); 29 | /* If in editMode */ 30 | if (this.inEditMode) { 31 | /* in editMode */ 32 | this.editAnnotation(this.annotation); 33 | /* toggle editMode */ 34 | this.inEditMode = false; 35 | } else { 36 | /* toggle editMode */ 37 | this.inEditMode = true; 38 | if(this.editInputValue !== this.annotation.bodyValue) { 39 | this.editInputValue = this.annotation.bodyValue; 40 | } 41 | } 42 | }; 43 | 44 | /* Bind deleteAnnotation to delete button. */ 45 | deleteButtonOnClick = (e: any) => { 46 | e.stopPropagation(); 47 | this.deleteAnnotation(this.annotation.id); 48 | }; 49 | 50 | listItemOnClick = () => { 51 | this.annotationManager.selectAnnotation(this.annotation.id) 52 | .then(() => {}) 53 | .catch((error: any) => { 54 | console.log(error); 55 | }); 56 | } 57 | 58 | /* Edit an existing annotation using Annotation API */ 59 | editAnnotation = (annotation: any) => { 60 | annotation.bodyValue = this.editInputValue; 61 | this.annotationManager.updateAnnotation(annotation) 62 | .then(() => { 63 | console.log('Annotation updated successfully.'); 64 | }) 65 | .catch((error: any) => { 66 | console.log(error); 67 | }); 68 | }; 69 | 70 | /* Delete an existing annotation from Annotation API */ 71 | deleteAnnotation = (annotationId: string) => { 72 | const filter = { 73 | annotationIds: [annotationId] 74 | }; 75 | this.annotationManager.deleteAnnotations(filter) 76 | .then(() => { 77 | console.log('Annotation deleted successfully.'); 78 | }) 79 | .catch((error: any) => { 80 | console.log(error); 81 | }); 82 | }; 83 | 84 | ngAfterViewInit() { 85 | /* Set default input value */ 86 | this.editInputValue = this.annotation.bodyValue; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-apis/ui-configurations/ui-configurations.component.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | .container { 13 | width: 100vw; 14 | height: 100vh; 15 | display: flex; 16 | } 17 | 18 | .pdf-view { 19 | width: calc(100% - 400px); 20 | } 21 | 22 | .annotations-container { 23 | border-left: 1px solid #333; 24 | width: 400px; 25 | height: 100vh; 26 | } 27 | 28 | ul { 29 | margin: 0 5px; 30 | padding: 0; 31 | } 32 | 33 | li * { 34 | float: left; 35 | } 36 | 37 | li, h3 { 38 | clear: both; 39 | list-style: none; 40 | } 41 | 42 | input, button { 43 | outline: none; 44 | } 45 | 46 | button { 47 | background: none; 48 | border: 0px; 49 | color: #888; 50 | font-size: 15px; 51 | width: 60px; 52 | margin: 10px 0 0; 53 | font-family: Lato, sans-serif; 54 | cursor: pointer; 55 | } 56 | 57 | button:hover { 58 | color: #333; 59 | } 60 | 61 | /* Heading */ 62 | h3 { 63 | color: #333; 64 | font-weight: 700; 65 | font-size: 15px; 66 | border-bottom: 1px solid #333; 67 | padding: 15px 0 14px; 68 | margin: 0; 69 | text-align: center; 70 | text-transform: uppercase; 71 | } 72 | 73 | input[type='text'] { 74 | margin: 0; 75 | font-size: 18px; 76 | line-height: 18px; 77 | height: 18px; 78 | padding: 10px; 79 | border: 1px solid #ddd; 80 | background: #fff; 81 | border-radius: 6px; 82 | font-family: Lato, sans-serif; 83 | color: #888; 84 | } 85 | 86 | input[type='text']:focus { 87 | color: #333; 88 | } 89 | 90 | /* Annotation list */ 91 | li { 92 | overflow: hidden; 93 | margin: 5px 0; 94 | padding: 10px 0; 95 | width: auto; 96 | border: 2px solid #3D85B0; 97 | } 98 | 99 | li > input[type='checkbox'] { 100 | margin: 0 10px; 101 | position: relative; 102 | top: 15px; 103 | } 104 | 105 | li > label { 106 | font-size: 18px; 107 | line-height: 40px; 108 | width: 237px; 109 | padding: 0 0 0 11px; 110 | } 111 | 112 | li > input[type='text'] { 113 | width: 226px; 114 | } 115 | 116 | li > .delete:hover { 117 | color: #CF2323; 118 | } 119 | 120 | .selected { 121 | border: 2px solid #3D85B0; 122 | } 123 | 124 | .unselected { 125 | border: 2px solid #eee; 126 | } 127 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-apis/ui-configurations/ui-configurations.component.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 5 | 6 |
    7 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-apis/ui-configurations/ui-configurations.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component, AfterViewInit, ViewEncapsulation } from '@angular/core'; 13 | import { ViewSDKClient } from '../../view-sdk.service'; 14 | 15 | @Component({ 16 | templateUrl: './ui-configurations.component.html', 17 | styleUrls: ['./ui-configurations.component.css'], 18 | encapsulation: ViewEncapsulation.None 19 | }) 20 | export class UIConfigurationsComponent implements AfterViewInit { 21 | previewFilePromise: any; 22 | annotationManager: any; 23 | 24 | viewerConfig = { 25 | /* Enable commenting APIs */ 26 | enableAnnotationAPIs: true, /* Default value is false */ 27 | }; 28 | 29 | constructor(private viewSDKClient: ViewSDKClient) { } 30 | 31 | ngAfterViewInit() { 32 | this.viewSDKClient.ready().then(() => { 33 | /* Invoke the file preview and get the Promise object */ 34 | this.previewFilePromise = this.viewSDKClient.previewFile('pdf-div', this.viewerConfig); 35 | /* Use the annotation manager interface to invoke the commenting APIs */ 36 | this.previewFilePromise.then((adobeViewer: any) => { 37 | adobeViewer.getAnnotationManager().then((annotManager: any) => { 38 | this.annotationManager = annotManager; 39 | /* Set UI configurations */ 40 | const customFlags = { 41 | /* showToolbar: false, /* Default value is true */ 42 | showCommentsPanel: false, /* Default value is true */ 43 | downloadWithAnnotations: true, /* Default value is false */ 44 | printWithAnnotations: true, /* Default value is false */ 45 | }; 46 | this.annotationManager.setConfig(customFlags); 47 | }); 48 | }); 49 | }); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-tools/pdf-annotation-tools.component.html: -------------------------------------------------------------------------------- 1 |
    2 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/pdf-annotation-tools/pdf-annotation-tools.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component, AfterViewInit } from '@angular/core'; 13 | import { ViewSDKClient } from '../view-sdk.service'; 14 | 15 | @Component({ 16 | templateUrl: './pdf-annotation-tools.component.html', 17 | }) 18 | export class PDFAnnotationToolsComponent implements AfterViewInit { 19 | constructor(private viewSDKClient: ViewSDKClient) { } 20 | 21 | ngAfterViewInit() { 22 | this.viewSDKClient.ready().then(() => { 23 | /* Invoke file preview */ 24 | this.viewSDKClient.previewFile('pdf-div', { 25 | /* Control the viewer customization. */ 26 | showAnnotationTools: true, 27 | enableFormFilling: true 28 | }); 29 | /* Register Save API handler */ 30 | this.viewSDKClient.registerSaveApiHandler(); 31 | }); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/viewer-customization/viewer-customization.component.html: -------------------------------------------------------------------------------- 1 |
    2 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/app/samples/viewer-customization/viewer-customization.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { Component, AfterViewInit } from '@angular/core'; 13 | import { ViewSDKClient } from '../view-sdk.service'; 14 | 15 | @Component({ 16 | templateUrl: './viewer-customization.component.html' 17 | }) 18 | export class ViewerCustomizationComponent implements AfterViewInit { 19 | /* Control the viewer customization. 20 | * It lists down all supported variables with default values. 21 | **/ 22 | viewerConfig = { 23 | /* If true, tools such as sticky note, highlight, and so on appear in the quick tools menu. */ 24 | showAnnotationTools: true, 25 | 26 | /* If true, form filling is enabled and users can edit fields. */ 27 | enableFormFilling: true, 28 | 29 | /* If true, a download button appears in the overflow menu on the top bar. */ 30 | showDownloadPDF: true, 31 | 32 | /* If true, then a print PDF option appears in the overflow menu on the top bar. */ 33 | showPrintPDF: true, 34 | 35 | /* If true, the zoom controls are displayed on the right hand panel. */ 36 | showZoomControl: true, 37 | 38 | /* Allowed possible values are 'FIT_PAGE', 'FIT_WIDTH', 'TWO_COLUMN', 'TWO_COLUMN_FIT_PAGE', or ''. 39 | FIT_WIDTH expands the page horizontally to the full width of the document pane. 40 | FIT_PAGE displays the entire page in the current view so that no scrolling is required. 41 | TWO_COLUMN displays two pages side-by-side in the current view. 42 | TWO_COLUMN_FIT_PAGE displays two pages side-by-side where the pages are zoomed to page level. 43 | Note that end users can toggle the view mode on the right hand panel. */ 44 | defaultViewMode: '' 45 | }; 46 | 47 | constructor(private viewSDKClient: ViewSDKClient) { } 48 | 49 | ngAfterViewInit() { 50 | this.viewSDKClient.ready().then(() => { 51 | /* Invoke file preview */ 52 | this.viewSDKClient.previewFile('pdf-div', this.viewerConfig); 53 | }); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Adobe Acrobat Services PDF Embed API Angular Sample 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 13 | import { AppModule } from './app/app.module'; 14 | 15 | platformBrowserDynamic().bootstrapModule(AppModule) 16 | .catch(err => console.error(err)); 17 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import 'zone.js/dist/zone'; 13 | 14 | declare global { 15 | interface Window { 16 | AdobeDC: any; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": ["src/main.ts", "src/polyfills.ts"], 8 | "include": ["src/**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "downlevelIteration": true, 9 | "experimentalDecorators": true, 10 | "module": "esnext", 11 | "moduleResolution": "node", 12 | "importHelpers": true, 13 | "target": "es6", 14 | "lib": ["es2018", "dom"] 15 | }, 16 | "angularCompilerOptions": { 17 | "fullTemplateTypeCheck": true, 18 | "strictInjectionParameters": true 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /More Samples/Angular Samples/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rules": { 4 | "align": { 5 | "options": ["parameters", "statements"] 6 | }, 7 | "array-type": false, 8 | "arrow-return-shorthand": true, 9 | "curly": true, 10 | "deprecation": { 11 | "severity": "warning" 12 | }, 13 | "component-class-suffix": true, 14 | "contextual-lifecycle": true, 15 | "directive-class-suffix": true, 16 | "directive-selector": [true, "attribute", "app", "camelCase"], 17 | "component-selector": [true, "element", "app", "kebab-case"], 18 | "eofline": true, 19 | "import-blacklist": [true, "rxjs/Rx"], 20 | "import-spacing": true, 21 | "indent": { 22 | "options": ["spaces"] 23 | }, 24 | "max-classes-per-file": false, 25 | "max-line-length": [true, 140], 26 | "member-ordering": [ 27 | true, 28 | { 29 | "order": [ 30 | "static-field", 31 | "instance-field", 32 | "static-method", 33 | "instance-method" 34 | ] 35 | } 36 | ], 37 | "no-console": [true, "debug", "info", "time", "timeEnd", "trace"], 38 | "no-empty": false, 39 | "no-inferrable-types": [true, "ignore-params"], 40 | "no-non-null-assertion": true, 41 | "no-redundant-jsdoc": true, 42 | "no-switch-case-fall-through": true, 43 | "no-var-requires": false, 44 | "object-literal-key-quotes": [true, "as-needed"], 45 | "quotemark": [true, "single"], 46 | "semicolon": { 47 | "options": ["always"] 48 | }, 49 | "space-before-function-paren": { 50 | "options": { 51 | "anonymous": "never", 52 | "asyncArrow": "always", 53 | "constructor": "never", 54 | "method": "never", 55 | "named": "never" 56 | } 57 | }, 58 | "typedef-whitespace": { 59 | "options": [ 60 | { 61 | "call-signature": "nospace", 62 | "index-signature": "nospace", 63 | "parameter": "nospace", 64 | "property-declaration": "nospace", 65 | "variable-declaration": "nospace" 66 | }, 67 | { 68 | "call-signature": "onespace", 69 | "index-signature": "onespace", 70 | "parameter": "onespace", 71 | "property-declaration": "onespace", 72 | "variable-declaration": "onespace" 73 | } 74 | ] 75 | }, 76 | "variable-name": { 77 | "options": ["ban-keywords", "check-format", "allow-pascal-case"] 78 | }, 79 | "whitespace": { 80 | "options": [ 81 | "check-branch", 82 | "check-decl", 83 | "check-operator", 84 | "check-separator", 85 | "check-type", 86 | "check-typecast" 87 | ] 88 | }, 89 | "no-conflicting-lifecycle": true, 90 | "no-host-metadata-property": true, 91 | "no-input-rename": true, 92 | "no-inputs-metadata-property": true, 93 | "no-output-native": true, 94 | "no-output-on-prefix": true, 95 | "no-output-rename": true, 96 | "no-outputs-metadata-property": true, 97 | "template-banana-in-box": true, 98 | "template-no-negated-async": true, 99 | "use-lifecycle-interface": true, 100 | "use-pipe-transform-interface": true 101 | }, 102 | "rulesDirectory": ["codelyzer"] 103 | } 104 | -------------------------------------------------------------------------------- /More Samples/Capture PDF Embed API Events/README.md: -------------------------------------------------------------------------------- 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. 9 | -------------------------------------------------------------------------------- /More Samples/Capture PDF Embed API Events/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 |
    12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /More Samples/Capture PDF Embed API Events/index.js: -------------------------------------------------------------------------------- 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 Acrobat Services PDF Embed API 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: "", 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://acrobatservices.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: "", 34 | 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 | }); 62 | -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/Auto-click PDF Link/README.md: -------------------------------------------------------------------------------- 1 | # Auto-click PDF Link 2 | 3 | The PDF link will be auto-clicked as soon as the webpage loads and the PDF is displayed in the desired embed mode. In this sample, the PDF is displayed using sized container embed mode provided by PDF Embed API. 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. 9 | -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/Auto-click PDF Link/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample - Handle Search Engine Indexing 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

    Click on any link to view the PDF file

    14 | 43 |
    44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/Auto-click PDF Link/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | /* Render the first PDF when the webpage is completely loaded. */ 13 | document.addEventListener('DOMContentLoaded', function() { 14 | document.getElementsByClassName("view-pdf")[0].click(); 15 | }) 16 | 17 | /* Function to render the file using PDF Embed API on clicking the PDF link. */ 18 | function onClick(pdf, embedMode) { 19 | if (window.AdobeDC && window.AdobeDC.View) { 20 | showFile(pdf, embedMode); 21 | } 22 | 23 | /* Wait for Adobe Acrobat Services PDF Embed API to be ready. */ 24 | document.addEventListener("adobe_dc_view_sdk.ready", function () { 25 | showFile(pdf, embedMode); 26 | }); 27 | 28 | return false; 29 | }; 30 | 31 | function showFile(pdf, embedMode) { 32 | /* Initialize the AdobeDC View object */ 33 | var adobeDCView = new AdobeDC.View({ 34 | /* Pass your registered client id */ 35 | clientId: "" 36 | }); 37 | 38 | /* Pass the embed mode option here */ 39 | const viewerConfig = { 40 | embedMode: embedMode 41 | }; 42 | 43 | /* Invoke the file preview API on Adobe DC View object */ 44 | adobeDCView.previewFile({ 45 | /* Pass information on how to access the file */ 46 | content: { 47 | /* Location of file where it is hosted */ 48 | location: { 49 | url: "https://acrobatservices.adobe.com/view-sdk-demo/PDFs/" + pdf, 50 | /* 51 | If the file URL requires some additional headers, then it can be passed as follows:- 52 | header: [ 53 | { 54 | key: "", 55 | value: "", 56 | } 57 | ] 58 | */ 59 | }, 60 | }, 61 | /* Pass meta data of file */ 62 | metaData: { 63 | /* file name */ 64 | fileName: pdf 65 | } 66 | }, viewerConfig); 67 | } 68 | -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/Full Window/README.md: -------------------------------------------------------------------------------- 1 | # Full Window 2 | 3 | In this sample, a separate webpage has been created to display the PDFs in full window embed mode. Clicking on any PDF link will open the PDF in this webpage by passing the PDF reference. 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. -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/Full Window/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample - Handle Search Engine Indexing 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

    Click on any link to view the PDF file

    13 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/Full Window/viewer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
    13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/Full Window/viewer.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | /* Control the default view mode */ 13 | const viewerConfig = { 14 | /* Allowed possible values are "FIT_PAGE", "FIT_WIDTH", "TWO_COLUMN", "TWO_COLUMN_FIT_PAGE" or "". */ 15 | defaultViewMode: "", 16 | }; 17 | 18 | /* Wait for Adobe Acrobat Services PDF Embed API to be ready */ 19 | document.addEventListener("adobe_dc_view_sdk.ready", function () { 20 | const urlParams = new URLSearchParams(window.location.search); 21 | const pdf = urlParams.get('pdf'); 22 | /* Initialize the AdobeDC View object */ 23 | var adobeDCView = new AdobeDC.View({ 24 | /* Pass your registered client id */ 25 | clientId: "", 26 | /* Pass the div id in which PDF should be rendered */ 27 | divId: "adobe-dc-view", 28 | }); 29 | 30 | /* Invoke the file preview API on Adobe DC View object */ 31 | adobeDCView.previewFile({ 32 | /* Pass information on how to access the file */ 33 | content: { 34 | /* Location of file where it is hosted */ 35 | location: { 36 | url: "https://acrobatservices.adobe.com/view-sdk-demo/PDFs/" + pdf, 37 | /* 38 | If the file URL requires some additional headers, then it can be passed as follows:- 39 | headers: [ 40 | { 41 | key: "", 42 | value: "", 43 | } 44 | ] 45 | */ 46 | }, 47 | }, 48 | /* Pass meta data of file */ 49 | metaData: { 50 | /* file name */ 51 | fileName: pdf 52 | } 53 | }, viewerConfig); 54 | }); 55 | -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/In Line PDF/README.md: -------------------------------------------------------------------------------- 1 | # In Line PDF 2 | 3 | In this sample, clicking on any PDF link will open the PDF in line within the same webpage. 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. 9 | -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/In Line PDF/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample - Handle Search Engine Indexing 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

    Click on any link to view the PDF file

    14 | 43 |
    44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/In Line PDF/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | /* Function to render the file using PDF Embed API on clicking the PDF link. */ 13 | function onClick(pdf, embedMode) { 14 | document.getElementById('adobe-dc-view').setAttribute('style', 'border: 1px solid lightgrey; width: 70vw; height: 50vw; margin: 0 auto;'); 15 | 16 | if (window.AdobeDC && window.AdobeDC.View) { 17 | showFile(pdf, embedMode); 18 | } 19 | 20 | /* Wait for Adobe Acrobat Services PDF Embed API to be ready. */ 21 | document.addEventListener("adobe_dc_view_sdk.ready", function () { 22 | showFile(pdf, embedMode); 23 | }); 24 | return false; 25 | }; 26 | 27 | function showFile(pdf, embedMode) { 28 | /* Initialize the AdobeDC View object */ 29 | var adobeDCView = new AdobeDC.View({ 30 | /* Pass your registered client id */ 31 | clientId: "" 32 | }); 33 | 34 | /* Pass the embed mode option here */ 35 | const viewerConfig = { 36 | embedMode: embedMode 37 | }; 38 | 39 | /* Invoke the file preview API on Adobe DC View object */ 40 | adobeDCView.previewFile({ 41 | /* Pass information on how to access the file */ 42 | content: { 43 | /* Location of file where it is hosted */ 44 | location: { 45 | url: "https://acrobatservices.adobe.com/view-sdk-demo/PDFs/" + pdf, 46 | /* 47 | If the file URL requires some additional headers, then it can be passed as follows:- 48 | header: [ 49 | { 50 | key: "", 51 | value: "", 52 | } 53 | ] 54 | */ 55 | }, 56 | }, 57 | /* Pass meta data of file */ 58 | metaData: { 59 | /* file name */ 60 | fileName: pdf 61 | } 62 | }, viewerConfig); 63 | } 64 | -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/Lightbox Embed Mode/README.md: -------------------------------------------------------------------------------- 1 | # Lightbox Embed Mode 2 | 3 | In this sample, clicking on any PDF link will open the PDF on top of the same webpage using the lightbox embed mode provided by PDF Embed API. This provides a focused view of the PDF and user can exit the PDF preview to go back to the webpage. 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. 9 | -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/Lightbox Embed Mode/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample - Handle Search Engine Indexing 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

    Click on any link to view the PDF file

    14 | 43 |
    44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/Lightbox Embed Mode/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | /* Function to render the file using PDF Embed API on clicking the PDF link. */ 13 | function onClick(pdf, embedMode) { 14 | if (window.AdobeDC && window.AdobeDC.View) { 15 | showFile(pdf, embedMode); 16 | } 17 | 18 | /* Wait for Adobe Acrobat Services PDF Embed API to be ready. */ 19 | document.addEventListener("adobe_dc_view_sdk.ready", function () { 20 | showFile(pdf, embedMode); 21 | }); 22 | 23 | return false; 24 | }; 25 | 26 | function showFile(pdf, embedMode) { 27 | /* Initialize the AdobeDC View object */ 28 | var adobeDCView = new AdobeDC.View({ 29 | /* Pass your registered client id */ 30 | clientId: "" 31 | }); 32 | 33 | /* Pass the embed mode option here */ 34 | const viewerConfig = { 35 | embedMode: embedMode 36 | }; 37 | 38 | /* Invoke the file preview API on Adobe DC View object */ 39 | adobeDCView.previewFile({ 40 | /* Pass information on how to access the file */ 41 | content: { 42 | /* Location of file where it is hosted */ 43 | location: { 44 | url: "https://acrobatservices.adobe.com/view-sdk-demo/PDFs/" + pdf, 45 | /* 46 | If the file URL requires some additional headers, then it can be passed as follows:- 47 | header: [ 48 | { 49 | key: "", 50 | value: "", 51 | } 52 | ] 53 | */ 54 | }, 55 | }, 56 | /* Pass meta data of file */ 57 | metaData: { 58 | /* file name */ 59 | fileName: pdf 60 | } 61 | }, viewerConfig); 62 | } 63 | -------------------------------------------------------------------------------- /More Samples/Handle Search Engine Indexing/README.md: -------------------------------------------------------------------------------- 1 | # Handle Search Engine Indexing 2 | 3 | PDFs displayed using PDF Embed API are not indexed and won't appear in search engine results by default, as PDF Embed API doesn't keep direct reference of the PDF URL in the DOM. In order to get the PDF indexed and appear in search engine results, the URL of the PDF must be available in the website DOM. 4 | We suggest an approach which will enable the indexing of PDF files displayed using PDF Embed API. The link of the PDF file should already be available in the website to enable indexing. As per the approach, website developers can trap the click of this link and open the PDF using PDF Embed API. 5 | 6 | The code samples demonstrate few of the ways to implement this approach. 7 | 8 | ### Auto-click PDF Link 9 | 10 | Auto-click on the PDF link when the website is completely loaded and open the PDF in the desired embed mode. In this sample, the PDF is displayed in sized container embed mode. 11 | To see it in action, open ```Auto-click PDF Link/index.html``` in a supported browser. 12 | 13 | ### Full Window 14 | 15 | Click on the PDF link to display the PDFs in a separate webpage in full window embed mode by passing the PDF reference. 16 | To see it in action, open ```Full Window/index.html``` in a supported browser. 17 | 18 | ### In Line PDF 19 | 20 | Click on the PDF link to open the PDF in line within the context of the webpage. 21 | To see it in action, open ```In Line PDF/index.html``` in a supported browser. 22 | 23 | ### Lightbox Embed Mode 24 | 25 | Click on the PDF link to open the PDF on top of the webpage using the lightbox embed mode provided by PDF Embed API. 26 | To see it in action, open ```Lightbox Embed Mode/index.html``` in a supported browser. 27 | 28 | ## Documentation 29 | 30 | For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs. -------------------------------------------------------------------------------- /More Samples/Linearization/Bodea Brochure - Linearized.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/pdf-embed-api-samples/e09ed4082bc8b69c6968a357ee33f582f4cf2762/More Samples/Linearization/Bodea Brochure - Linearized.pdf -------------------------------------------------------------------------------- /More Samples/Linearization/README.md: -------------------------------------------------------------------------------- 1 | # Linearized PDF file Preview Sample 2 | 3 | This sample demonstrates how to render a linearized PDF file using the PDF Embed API. 4 | To see it in action, copy the files in the folder to your computer, open index.html in a supported browser, and select the sample PDF "Bodea Brochure - Linearized.pdf" available in this folder. 5 | 6 | ## Documentation 7 | 8 | For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs. 9 | -------------------------------------------------------------------------------- /More Samples/Linearization/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 |
    12 |
    13 | 14 | 15 |
    16 |
    17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/Annotation Data Samples/README.md: -------------------------------------------------------------------------------- 1 | # Annotation Data Samples 2 | 3 | Samples of acceptable annotation data for freetext, note, reply, highlight, underline, strikeout and shape annotation types in JSON format. 4 | 5 | ## Documentation 6 | 7 | For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs. 8 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/Annotation Data Samples/freetext.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": [ 3 | "https://www.w3.org/ns/anno.jsonld", 4 | "https://comments.acrobat.com/ns/anno.jsonld" 5 | ], 6 | "type": "Annotation", 7 | "id": "02dcf931-d1cb-49c1-a8bc-d047892a06bc", 8 | "bodyValue": "I added a text annotation!", 9 | "motivation": "commenting", 10 | "stylesheet": { 11 | "type": "CssStylesheet", 12 | "value": "body-value-css { font: 14px Helvetica; color: #0000FF; }" 13 | }, 14 | "target": { 15 | "source": "6d07d124-ac85-43b3-a867-36930f502ac6", 16 | "selector": { 17 | "node": { 18 | "index": 1 19 | }, 20 | "subtype": "freetext", 21 | "boundingBox": [ 22 | 306.41829735235586, 23 | 339.01199687491595, 24 | 475.729044456285, 25 | 357.0653042030006 26 | ], 27 | "styleClass": "body-value-css", 28 | "type": "AdobeAnnoSelector" 29 | } 30 | }, 31 | "creator": { 32 | "type": "Person", 33 | "name": "John Smith" 34 | }, 35 | "created": "2021-01-20T14:45:37Z", 36 | "modified": "2021-01-20T14:45:37Z" 37 | } 38 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/Annotation Data Samples/highlight.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": [ 3 | "https://www.w3.org/ns/anno.jsonld", 4 | "https://comments.acrobat.com/ns/anno.jsonld" 5 | ], 6 | "type": "Annotation", 7 | "id": "17bf889a-f170-4c13-a655-4b1e5de0bf41", 8 | "bodyValue": "I highlighted this!", 9 | "motivation": "commenting", 10 | "target": { 11 | "source": "6d07d124-ac85-43b3-a867-36930f502ac6", 12 | "selector": { 13 | "node": { 14 | "index": 3 15 | }, 16 | "opacity": 0.1, 17 | "subtype": "highlight", 18 | "boundingBox": [ 19 | 71.69551583223566, 20 | 325.5741406817769, 21 | 160.0787810392158, 22 | 345.3522140148074 23 | ], 24 | "quadPoints": [ 25 | 71.69551583223566, 26 | 345.3522140148074, 27 | 160.0787810392158, 28 | 345.3522140148074, 29 | 71.69551583223566, 30 | 325.5741406817769, 31 | 160.0787810392158, 32 | 325.5741406817769 33 | ], 34 | "strokeColor": "#5300eb", 35 | "strokeWidth": 3, 36 | "type": "AdobeAnnoSelector" 37 | } 38 | }, 39 | "creator": { 40 | "type": "Person", 41 | "name": "John Smith" 42 | }, 43 | "created": "2020-02-21T14:45:37Z", 44 | "modified": "2020-02-21T07:54:10Z" 45 | } 46 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/Annotation Data Samples/note.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": [ 3 | "https://www.w3.org/ns/anno.jsonld", 4 | "https://comments.acrobat.com/ns/anno.jsonld" 5 | ], 6 | "type": "Annotation", 7 | "id": "079d66a4-5ec2-4703-ae9d-30ccbb1aa84c", 8 | "bodyValue": "I added a note!", 9 | "motivation": "commenting", 10 | "target": { 11 | "source": "6d07d124-ac85-43b3-a867-36930f502ac6", 12 | "selector": { 13 | "node": { 14 | "index": 1 15 | }, 16 | "opacity": 0.4, 17 | "subtype": "note", 18 | "boundingBox": [ 19 | 56.86196083246276, 20 | 63.51466901912244, 21 | 74.16777499886447, 22 | 80.82048318552415 23 | ], 24 | "strokeColor": "#ff0808", 25 | "strokeWidth": 3, 26 | "type": "AdobeAnnoSelector" 27 | } 28 | }, 29 | "creator": { 30 | "type": "Person", 31 | "name": "John Smith" 32 | }, 33 | "created": "2018-08-02T14:45:37Z", 34 | "modified": "2020-01-20T07:54:10Z" 35 | } 36 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/Annotation Data Samples/reply.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": [ 3 | "https://www.w3.org/ns/anno.jsonld", 4 | "https://comments.acrobat.com/ns/anno.jsonld" 5 | ], 6 | "type": "Annotation", 7 | "id": "eb46d1a9-e9c3-4e81-a6f4-ce5ba7a905e9", 8 | "bodyValue": "Reply to this", 9 | "motivation": "replying", 10 | "target": { 11 | "source": "079d66a4-5ec2-4703-ae9d-30ccbb1aa84c" 12 | }, 13 | "creator": { 14 | "type": "Person", 15 | "name": "Steve Baker" 16 | }, 17 | "created": "2020-02-02T14:45:37Z", 18 | "modified": "2020-02-02T07:57:03Z" 19 | } 20 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/Annotation Data Samples/strikeout.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": [ 3 | "https://www.w3.org/ns/anno.jsonld", 4 | "https://comments.acrobat.com/ns/anno.jsonld" 5 | ], 6 | "type": "Annotation", 7 | "id": "3adeae16-a868-4653-960e-613c048dddc5", 8 | "bodyValue": "I added a strikeout.", 9 | "motivation": "commenting", 10 | "target": { 11 | "source": "6d07d124-ac85-43b3-a867-36930f502ac6", 12 | "selector": { 13 | "node": { 14 | "index": 2 15 | }, 16 | "opacity": 0.4, 17 | "subtype": "strikeout", 18 | "boundingBox": [ 19 | 72.31358062389286, 20 | 307.65026172371796, 21 | 251.552370204482, 22 | 316.921233598576 23 | ], 24 | "quadPoints": [ 25 | 72.31358062389286, 26 | 316.921233598576, 27 | 251.552370204482, 28 | 316.921233598576, 29 | 72.31358062389286, 30 | 307.65026172371796, 31 | 251.552370204482, 32 | 307.65026172371796 33 | ], 34 | "strokeColor": "#b80000", 35 | "strokeWidth": 3, 36 | "type": "AdobeAnnoSelector" 37 | } 38 | }, 39 | "creator": { 40 | "type": "Person", 41 | "name": "John Smith" 42 | }, 43 | "created": "2020-02-21T14:45:37Z", 44 | "modified": "2020-02-21T07:54:10Z" 45 | } 46 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/Annotation Data Samples/underline.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": [ 3 | "https://www.w3.org/ns/anno.jsonld", 4 | "https://comments.acrobat.com/ns/anno.jsonld" 5 | ], 6 | "type": "Annotation", 7 | "id": "34c2bb70-60e2-4405-be33-a3c9865791e0", 8 | "bodyValue": "I underlined this text!", 9 | "motivation": "commenting", 10 | "target": { 11 | "source": "6d07d124-ac85-43b3-a867-36930f502ac6", 12 | "selector": { 13 | "node": { 14 | "index": 4 15 | }, 16 | "opacity": 0.1, 17 | "subtype": "underline", 18 | "boundingBox": [ 19 | 72.31358062389286, 20 | 306.4141321404036, 21 | 256.4968885377396, 22 | 315.68510401526163 23 | ], 24 | "quadPoints": [ 25 | 72.31358062389286, 26 | 315.68510401526163, 27 | 256.4968885377396, 28 | 315.68510401526163, 29 | 72.31358062389286, 30 | 306.4141321404036, 31 | 256.4968885377396, 32 | 306.4141321404036 33 | ], 34 | "strokeColor": "#008b02", 35 | "strokeWidth": 3, 36 | "type": "AdobeAnnoSelector" 37 | } 38 | }, 39 | "creator": { 40 | "type": "Person", 41 | "name": "John Smith" 42 | }, 43 | "created": "2020-02-21T14:45:37Z", 44 | "modified": "2020-02-21T07:54:10Z" 45 | } 46 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/CRUD APIs/README.md: -------------------------------------------------------------------------------- 1 | # Sample for PDF Annotations APIs 2 | 3 | In this sample, no existing PDF annotation is displayed. Any annotation added or updated from UI or API is not saved to the PDF buffer. 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. 9 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/CRUD APIs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
    13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/Capture Events/README.md: -------------------------------------------------------------------------------- 1 | # Annotation APIs with Events Sample 2 | 3 | This sample shows how to receive annotation events when annotation APIs are 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 | ## Documentation 7 | 8 | For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs. 9 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/Capture Events/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
    13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/Capture Events/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | var viewerConfig = { 13 | /* Enable commenting APIs */ 14 | enableAnnotationAPIs: true, /* Default value is false */ 15 | }; 16 | 17 | /* Wait for Adobe Acrobat Services PDF Embed API 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: "", 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 and return the Promise object */ 28 | var previewFilePromise = 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://acrobatservices.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: "", 39 | value: "", 40 | } 41 | ] 42 | */ 43 | }, 44 | }, 45 | /* Pass meta data of file */ 46 | metaData: { 47 | /* file name */ 48 | fileName: "Bodea Brochure.pdf", 49 | /* file ID */ 50 | id: "6d07d124-ac85-43b3-a867-36930f502ac6" 51 | } 52 | }, viewerConfig); 53 | 54 | /* Use the annotation manager interface to invoke the commenting APIs */ 55 | previewFilePromise.then(function (adobeViewer) { 56 | adobeViewer.getAnnotationManager().then(function (annotationManager) { 57 | /* API to add annotations */ 58 | annotationManager.addAnnotations(annotations) 59 | .then(function () { 60 | console.log("Annotations added through API successfully") 61 | }) 62 | .catch(function (error) { 63 | console.log(error) 64 | }); 65 | 66 | /* API to register events listener */ 67 | annotationManager.registerEventListener( 68 | function (event) { 69 | console.log(event) 70 | }, 71 | { 72 | /* Pass the list of events in listenOn. */ 73 | /* If no event is passed in listenOn, then all the annotation events will be received. */ 74 | listenOn: [ 75 | /* "ANNOTATION_ADDED", "ANNOTATION_CLICKED" */ 76 | ] 77 | } 78 | ); 79 | }); 80 | }); 81 | }); 82 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/Handling of Annotations in PDF/README.md: -------------------------------------------------------------------------------- 1 | # Handling existing PDF Annotations Sample 2 | 3 | Sample for annotations APIs used to remove existing annotations from PDF or save some annotations to the PDF and return the updated PDF buffer. 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. 9 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/Handling of Annotations in PDF/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
    13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/Handling of Annotations in PDF/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | var viewerConfig = { 13 | /* Enable commenting APIs */ 14 | enableAnnotationAPIs: true, /* Default value is false */ 15 | /* Include existing PDF annotations and save new annotations to PDF buffer */ 16 | includePDFAnnotations: true /* Default value is false */ 17 | }; 18 | 19 | /* Wait for Adobe Acrobat Services PDF Embed API to be ready */ 20 | document.addEventListener("adobe_dc_view_sdk.ready", function () { 21 | /* Initialize the AdobeDC View object */ 22 | var adobeDCView = new AdobeDC.View({ 23 | /* Pass your registered client id */ 24 | clientId: "", 25 | /* Pass the div id in which PDF should be rendered */ 26 | divId: "adobe-dc-view", 27 | }); 28 | 29 | /* Invoke the file preview API on Adobe DC View object and return the Promise object */ 30 | var previewFilePromise = adobeDCView.previewFile({ 31 | /* Pass information on how to access the file */ 32 | content: { 33 | /* Location of file where it is hosted */ 34 | location: { 35 | url: "https://acrobatservices.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf", 36 | /* 37 | If the file URL requires some additional headers, then it can be passed as follows:- 38 | header: [ 39 | { 40 | key: "", 41 | value: "", 42 | } 43 | ] 44 | */ 45 | }, 46 | }, 47 | /* Pass meta data of file */ 48 | metaData: { 49 | /* file name */ 50 | fileName: "Bodea Brochure.pdf", 51 | /* file ID */ 52 | id: "6d07d124-ac85-43b3-a867-36930f502ac6" 53 | } 54 | }, viewerConfig); 55 | 56 | /* Use the annotation manager interface to invoke the commenting APIs*/ 57 | previewFilePromise.then(function (adobeViewer) { 58 | adobeViewer.getAnnotationManager().then(function (annotationManager) { 59 | /* API to add annotations to PDF and return the updated PDF buffer */ 60 | /* These APIs will work only when includePDFAnnotations is set to true in viewerConfig */ 61 | annotationManager.addAnnotationsInPDF(annotations) 62 | .then(function (result) { 63 | console.log("Annotations added to PDF successfully and updated PDF buffer returned.", result) 64 | }) 65 | .catch(function (error) { 66 | console.log(error) 67 | }); 68 | 69 | /* API to remove annotations from PDF and return the updated PDF buffer along with the list of annotations */ 70 | setTimeout(function() { 71 | annotationManager.removeAnnotationsFromPDF() 72 | .then(function (result) { 73 | console.log("Annotations removed from PDF successfully and updated PDF buffer and annotation list returned.", result) 74 | }) 75 | .catch(function (error) { 76 | console.log(error) 77 | }); 78 | }, 3000); 79 | }); 80 | }); 81 | }); 82 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/README.md: -------------------------------------------------------------------------------- 1 | # PDF Annotation API Samples 2 | 3 | PDF viewer will render PDF file along with annotation APIs enabled. Annotation APIs can be used to add, import, export, delete and update annotations programmatically. 4 | 5 | ### CRUD APIs 6 | 7 | PDF viewer will render PDF file along with annotation tools and APIs enabled. 8 | Code in ```CRUD APIs/index.js``` shows the annotation APIs interaction with PDF Embed API. 9 | In this sample, no existing PDF annotation is displayed. Any annotation added or updated from UI or API is not saved to the PDF buffer. 10 | To see it in action, open ```CRUD APIs/index.html``` in a supported browser. 11 | 12 | ### Handling of Annotations in PDF 13 | 14 | PDF viewer will render PDF file along with annotation tools and APIs enabled. 15 | This sample show how to interact with existing annotations in PDF or add new annotations in PDF buffer. 16 | To see it in action, open ```Handling of Annotations in PDF/index.html``` in a supported browser. 17 | 18 | ### Capture Events 19 | 20 | PDF viewer will render PDF file along with annotation tools and APIs enabled and shows how to receive annotation events. 21 | To see it in action, open ```Capture Events/index.html``` in a supported browser. 22 | 23 | ### UI Configurations 24 | 25 | PDF viewer will render PDF file along with annotation tools and APIs enabled and shows how we can build our own custom comments panel UI by using various annotation APIs and events. 26 | To see it in action, open ```UI Configurations/index.html``` in a supported browser. 27 | 28 | ### Annotation Data Samples 29 | 30 | Folder ```Annotation Data Samples``` contains acceptable annotation data for freetext, note, reply, highlight, underline, strikeout and shape annotation types in JSON format. 31 | 32 | ## Documentation 33 | 34 | For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs. 35 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/UI Configurations/README.md: -------------------------------------------------------------------------------- 1 | # Annotation APIs with UI Configurations Sample 2 | 3 | This sample demonstrates how the annotation APIs can be used to apply UI configurations and perform other operations on any annotation. 4 | 5 | The right-hand comments pane has been hidden and a custom comments pane has been created. The annotation tools are also disabled and custom annotation tools have been created in the comments pane. 6 | Click on any annotation tool and it gets selected using the start annotation mode API. New annotations can be added to the PDF using these tools. 7 | The annotation added event is received and the event data is used to fetch the comment text and display it in the custom pane. 8 | There are options to edit and delete the annotation which use the update and delete annotation APIs to perform the operation. 9 | Click on any annotation in the custom pane and it gets selected using the select annotation API. 10 | 11 | To see it in action, copy the files in the folder to your computer, and open index.html in a supported browser. 12 | 13 | ## Documentation 14 | 15 | For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs. 16 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/UI Configurations/images/tool_add_text.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/UI Configurations/images/tool_drawing.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/UI Configurations/images/tool_eraser.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/UI Configurations/images/tool_highlight.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/UI Configurations/images/tool_stickynote.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/UI Configurations/images/tool_strikethrough.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/UI Configurations/images/tool_underline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/UI Configurations/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |

    15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
    24 | 25 | 37 | 52 |
    53 | 54 |

    55 |
      56 |
    57 |
    58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations APIs/UI Configurations/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | body { 13 | margin: 0; 14 | display: flex; 15 | height: 100vh; 16 | } 17 | 18 | .pdf-view { 19 | width: calc(100% - 400px); 20 | } 21 | 22 | .container { 23 | border-left: 1px solid #333; 24 | width: 400px; 25 | } 26 | 27 | .annotation-icon { 28 | opacity: 0.5; 29 | width: 25px; 30 | margin: 0 10px; 31 | } 32 | 33 | ul { 34 | margin: 0 5px; 35 | padding: 0; 36 | } 37 | 38 | li * { 39 | float: left; 40 | } 41 | 42 | li, h3 { 43 | clear: both; 44 | list-style: none; 45 | } 46 | 47 | input, button { 48 | outline: none; 49 | } 50 | 51 | button { 52 | background: none; 53 | border: 0px; 54 | color: #888; 55 | font-size: 15px; 56 | width: 60px; 57 | margin: 10px 0 0; 58 | font-family: Lato, sans-serif; 59 | cursor: pointer; 60 | } 61 | 62 | button:hover { 63 | color: #333; 64 | } 65 | 66 | /* Heading */ 67 | h3 { 68 | color: #333; 69 | font-weight: 700; 70 | font-size: 15px; 71 | border-bottom: 1px solid #333; 72 | padding: 9px 0 14px; 73 | margin: 0; 74 | text-align: center; 75 | text-transform: uppercase; 76 | } 77 | 78 | input[type="text"] { 79 | margin: 0; 80 | font-size: 18px; 81 | line-height: 18px; 82 | height: 18px; 83 | padding: 10px; 84 | border: 1px solid #ddd; 85 | background: #fff; 86 | border-radius: 6px; 87 | font-family: Lato, sans-serif; 88 | color: #888; 89 | } 90 | 91 | input[type="text"]:focus { 92 | color: #333; 93 | } 94 | 95 | /* Annotation list */ 96 | li { 97 | overflow: hidden; 98 | margin: 5px 0; 99 | padding: 10px 0; 100 | width: auto; 101 | border: 2px solid #3D85B0; 102 | } 103 | 104 | li > input[type="checkbox"] { 105 | margin: 0 10px; 106 | position: relative; 107 | top: 15px; 108 | } 109 | 110 | li > label { 111 | font-size: 18px; 112 | line-height: 40px; 113 | width: 237px; 114 | padding: 0 0 0 11px; 115 | } 116 | 117 | li > input[type="text"] { 118 | width: 226px; 119 | } 120 | 121 | li > .delete:hover { 122 | color: #CF2323; 123 | } 124 | 125 | /* Edit Annotation */ 126 | ul li input[type=text] { 127 | display: none; 128 | } 129 | 130 | ul li.editMode input[type=text] { 131 | display: block; 132 | } 133 | 134 | ul li.editMode label { 135 | display: none; 136 | } 137 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations/README.md: -------------------------------------------------------------------------------- 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. 11 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 |
    12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /More Samples/PDF Annotations/index.js: -------------------------------------------------------------------------------- 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 | /* Control the viewer customization. */ 13 | var viewerConfig = { 14 | showAnnotationTools: true, 15 | enableFormFilling: true, 16 | }; 17 | 18 | /* Wait for Adobe Acrobat Services PDF Embed API to be ready */ 19 | document.addEventListener("adobe_dc_view_sdk.ready", function () { 20 | /* Initialize the AdobeDC View object */ 21 | var adobeDCView = new AdobeDC.View({ 22 | /* Pass your registered client id */ 23 | clientId: "", 24 | /* Pass the div id in which PDF should be rendered */ 25 | divId: "adobe-dc-view", 26 | }); 27 | 28 | /* Invoke the file preview API on Adobe DC View object */ 29 | adobeDCView.previewFile({ 30 | /* Pass information on how to access the file */ 31 | content: { 32 | /* Location of file where it is hosted */ 33 | location: { 34 | url: "https://acrobatservices.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf", 35 | /* 36 | If the file URL requires some additional headers, then it can be passed as follows:- 37 | headers: [ 38 | { 39 | key: "", 40 | value: "", 41 | } 42 | ] 43 | */ 44 | }, 45 | }, 46 | /* Pass meta data of file */ 47 | metaData: { 48 | /* file name */ 49 | fileName: "Bodea Brochure.pdf" 50 | } 51 | }, viewerConfig); 52 | 53 | /* Define Save API Handler */ 54 | var saveApiHandler = function (metaData, content, options) { 55 | console.log(metaData, content, options); 56 | return new Promise(function (resolve, reject) { 57 | /* Dummy implementation of Save API, replace with your business logic */ 58 | setTimeout(function () { 59 | var response = { 60 | code: AdobeDC.View.Enum.ApiResponseCode.SUCCESS, 61 | data: { 62 | metaData: Object.assign(metaData, {updatedAt: new Date().getTime()}) 63 | }, 64 | }; 65 | resolve(response); 66 | }, 2000); 67 | }); 68 | }; 69 | 70 | adobeDCView.registerCallback( 71 | AdobeDC.View.Enum.CallbackType.SAVE_API, 72 | saveApiHandler, 73 | {} 74 | ); 75 | }); 76 | -------------------------------------------------------------------------------- /More Samples/React Samples/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /More Samples/React Samples/.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict=true 2 | -------------------------------------------------------------------------------- /More Samples/React Samples/README.md: -------------------------------------------------------------------------------- 1 | # React Sample 2 | 3 | This is a React sample application, demonstrating how to use Adobe Acrobat Services PDF Embed API with React. To try it out, clone this folder on your computer and run the following commands: 4 | 5 | ``` 6 | > npm install 7 | > npm start 8 | ``` 9 | 10 | The app will be available at ```http://localhost:3000``` 11 | 12 | Below are the endpoints exposed from the application to show different use cases of PDF embed API. 13 | 14 | For detailed description about each of the samples, see [README](../../README.md#running-the-samples). 15 | 16 | | Sample | Endpoint | 17 | |---|---| 18 | |Full Window Embed Mode | ```http://localhost:3000/fullWindow``` | 19 | |Sized Container Embed Mode | ```http://localhost:3000/sizedContainer``` | 20 | |In-Line Embed Mode | ```http://localhost:3000/inLine``` | 21 | |Lightbox Embed Mode | ```http://localhost:3000/lightbox``` | 22 | |PDF Preview with Annotation Tools | ```http://localhost:3000/pdfAnnotationTools``` | 23 | |Viewer Customization | ```http://localhost:3000/viewerCustomization``` | 24 | |Local PDF File Preview | ```http://localhost:3000/localPDFFilePreview``` | 25 | |PDF Preview with Events | ```http://localhost:3000/captureEvents``` | 26 | 27 | 28 | Following endpoints showcase the different PDF Annotation APIs and their use cases. 29 | 30 | For detailed description about the annotation APIs samples, see [Annotation APIs README](../PDF%20Annotations%20APIs/README.md). 31 | 32 | | Annotation API Sample | Endpoint | 33 | |---|---| 34 | |CRUD APIs | ```http://localhost:3000/annotationAPIs``` | 35 | |Handling of Annotations in PDF | ```http://localhost:3000/annotationAPIs/handlingInPDF``` | 36 | |Capture Events | ```http://localhost:3000/annotationAPIs/captureEvents``` | 37 | |UI Configurations | ```http://localhost:3000/annotationAPIs/UIConfigurations``` | 38 | 39 | 40 | **Note**: Node version >=8.10.0 is required to run this sample. 41 | -------------------------------------------------------------------------------- /More Samples/React Samples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "adobe-dc-view-sdk-react-sample", 3 | "version": "1.0.0", 4 | "private": false, 5 | "license": "See license in license.md", 6 | "dependencies": { 7 | "react": "^16.13.0", 8 | "react-dom": "^16.13.0", 9 | "react-router-dom": "^5.1.2", 10 | "react-scripts": "3.4.0" 11 | }, 12 | "scripts": { 13 | "start": "react-scripts start" 14 | }, 15 | "engines": { 16 | "node": ">=8.10.0" 17 | }, 18 | "browserslist": { 19 | "development": [ 20 | "last 2 Chrome versions", 21 | "last 2 Firefox versions", 22 | "last 2 Edge versions", 23 | "last 2 Safari versions" 24 | ] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /More Samples/React Samples/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API React Sample 5 | 6 | 7 | 8 | 9 | 10 |
    11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/App.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | .in-line-div { 13 | display: inline-block; 14 | margin: 10% 0 10% 0; 15 | width: 800px; 16 | box-shadow: 1px 1px 10px 1px #dadada; 17 | } 18 | 19 | .in-line-container { 20 | text-align: center; 21 | } 22 | 23 | .sized-container-div { 24 | margin: auto; 25 | margin-top: 5%; 26 | height: 476px; 27 | width: 600px; 28 | border: 1px solid #dadada; 29 | } 30 | 31 | .full-window-div { 32 | height: 100%; 33 | } 34 | 35 | .light-box-container { 36 | background-color: #fdfdf9; 37 | height: 100%; 38 | } 39 | 40 | .lb-view-file-btn { 41 | background-color: #1473e6; 42 | border: 1px #404040; 43 | border-radius: 5px; 44 | color: #ededed; 45 | cursor: pointer; 46 | font-family: "Arial"; 47 | margin: 100px 0 0 80px; 48 | padding: 10px; 49 | width: 120px; 50 | } 51 | 52 | .lb-view-file-btn:hover { 53 | background-color: #0969df; 54 | color: white; 55 | } 56 | 57 | .file-input { 58 | display: none; 59 | } 60 | 61 | .file-picker { 62 | font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; 63 | padding: 10px; 64 | border-radius: 5px; 65 | border: 1px #404040; 66 | cursor: pointer; 67 | color: #ededed; 68 | display: inline-block; 69 | background-color: #404040; 70 | box-shadow: 12px 5px 30px -12px rgba(0, 0, 0, 0.58); 71 | } 72 | 73 | .file-picker:hover { 74 | color: white; 75 | background-color: #252525; 76 | } 77 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/App.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import React, { Component } from "react"; 13 | import { BrowserRouter as Router, Route } from "react-router-dom"; 14 | import FullWindow from "./samples/Embed Modes/FullWindow"; 15 | import PDFAnnotationTools from "./samples/PDFAnnotationTools"; 16 | import SizedContainer from "./samples/Embed Modes/SizedContainer"; 17 | import InLine from "./samples/Embed Modes/InLine"; 18 | import Lightbox from "./samples/Embed Modes/Lightbox"; 19 | import ViewerCustomization from "./samples/ViewerCustomization"; 20 | import CaptureViewSDKEvents from "./samples/CaptureViewSDKEvents"; 21 | import LocalPDFFilePreview from "./samples/LocalPDFFilePreview"; 22 | import CaptureEvents from "./samples/PDF Annotation APIs/CaptureEvents"; 23 | import CRUDAPIs from "./samples/PDF Annotation APIs/CRUDAPIs"; 24 | import HandlingAnnotationsInPDF from "./samples/PDF Annotation APIs/HandlingAnnotationsInPDF"; 25 | import UIConfigurations from "./samples/PDF Annotation APIs/UIConfigurations/UIConfigurations"; 26 | import "./App.css"; 27 | 28 | export default class App extends Component { 29 | render() { 30 | return ( 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import React from 'react'; 13 | import ReactDOM from 'react-dom'; 14 | import App from './App'; 15 | 16 | ReactDOM.render(, document.getElementById("root")); 17 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/samples/CaptureViewSDKEvents.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import React, { Component } from 'react'; 13 | import ViewSDKClient from './ViewSDKClient'; 14 | 15 | class CaptureViewSDKEvents extends Component { 16 | componentDidMount() { 17 | const viewSDKClient = new ViewSDKClient(); 18 | viewSDKClient.ready().then(() => { 19 | /* Invoke file preview */ 20 | viewSDKClient.previewFile("pdf-div", {}); 21 | /* Register the callback to receive the events */ 22 | viewSDKClient.registerEventsHandler(); 23 | }); 24 | } 25 | 26 | render() { 27 | return
    ; 28 | } 29 | } 30 | 31 | export default CaptureViewSDKEvents; 32 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/samples/Embed Modes/FullWindow.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import React, { Component } from 'react'; 13 | import ViewSDKClient from '../ViewSDKClient'; 14 | 15 | class FullWindow extends Component { 16 | componentDidMount() { 17 | const viewSDKClient = new ViewSDKClient(); 18 | viewSDKClient.ready().then(() => { 19 | /* Invoke file preview */ 20 | /* By default the embed mode will be Full Window */ 21 | viewSDKClient.previewFile("pdf-div", {}); 22 | }); 23 | } 24 | 25 | render() { 26 | return
    ; 27 | } 28 | } 29 | 30 | export default FullWindow; 31 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/samples/Embed Modes/InLine.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import React, { Component } from "react"; 13 | import ViewSDKClient from "../ViewSDKClient"; 14 | 15 | class InLine extends Component { 16 | componentDidMount() { 17 | const viewSDKClient = new ViewSDKClient(); 18 | viewSDKClient.ready().then(() => { 19 | /* Invoke file preview */ 20 | viewSDKClient.previewFile("pdf-div", { 21 | /* Pass the embed mode option here */ 22 | embedMode: "IN_LINE" 23 | }); 24 | }); 25 | } 26 | 27 | render() { 28 | return ( 29 |
    30 |
    31 |
    32 | ); 33 | } 34 | } 35 | 36 | export default InLine; 37 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/samples/Embed Modes/Lightbox.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import React, { Component } from "react"; 13 | import ViewSDKClient from "../ViewSDKClient"; 14 | 15 | class Lightbox extends Component { 16 | constructor() { 17 | super(); 18 | this.viewSDKClient = new ViewSDKClient(); 19 | } 20 | 21 | previewFile = () => { 22 | this.viewSDKClient.ready().then(() => { 23 | /* Invoke file preview */ 24 | this.viewSDKClient.previewFile("", { 25 | /* Pass the embed mode option here */ 26 | embedMode: "LIGHT_BOX" 27 | }); 28 | }); 29 | } 30 | 31 | render() { 32 | return ( 33 |
    34 | 37 |
    38 | ); 39 | } 40 | } 41 | 42 | export default Lightbox; 43 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/samples/Embed Modes/SizedContainer.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import React, { Component } from 'react'; 13 | import ViewSDKClient from '../ViewSDKClient'; 14 | 15 | class SizedContainer extends Component { 16 | componentDidMount() { 17 | const viewSDKClient = new ViewSDKClient(); 18 | viewSDKClient.ready().then(() => { 19 | /* Invoke file preview */ 20 | viewSDKClient.previewFile("pdf-div", { 21 | /* Pass the embed mode option here */ 22 | embedMode: "SIZED_CONTAINER" 23 | }); 24 | }); 25 | } 26 | 27 | render() { 28 | return
    ; 29 | } 30 | } 31 | 32 | export default SizedContainer; 33 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/samples/LocalPDFFilePreview.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import React, { Component } from "react"; 13 | import ViewSDKClient from "./ViewSDKClient"; 14 | 15 | class LocalPDFFilePreview extends Component { 16 | constructor() { 17 | super(); 18 | this.viewSDKClient = new ViewSDKClient(); 19 | } 20 | 21 | /* Helper function to check if selected file is PDF or not. */ 22 | isValidPDF = file => { 23 | if (file.type === "application/pdf") { 24 | return true; 25 | } 26 | if (file.type === "" && file.name) { 27 | const fileName = file.name; 28 | const lastDotIndex = fileName.lastIndexOf("."); 29 | if (lastDotIndex === -1 || fileName.substr(lastDotIndex).toUpperCase() !== "PDF") return false; 30 | return true; 31 | } 32 | return false; 33 | }; 34 | 35 | /* Helper function to be executed on file upload 36 | * for creating Promise which resolve to ArrayBuffer of file data. 37 | **/ 38 | onFileUpload = event => { 39 | event.persist(); 40 | this.viewSDKClient.ready().then(() => { 41 | const files = event.target.files; 42 | if (files.length > 0 && this.isValidPDF(files[0])) { 43 | const fileName = files[0].name; 44 | const reader = new FileReader(); 45 | reader.onloadend = e => { 46 | const filePromise = Promise.resolve(e.target.result); 47 | /* Helper function to render the file using PDF Embed API. */ 48 | this.viewSDKClient.previewFileUsingFilePromise("pdf-div", filePromise, fileName); 49 | }; 50 | reader.readAsArrayBuffer(files[0]); 51 | } 52 | }); 53 | } 54 | 55 | render() { 56 | return ( 57 |
    58 |
    59 | 60 | {/* Listen for file upload */} 61 | 63 |
    64 |
    65 | ); 66 | } 67 | } 68 | 69 | export default LocalPDFFilePreview; 70 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/samples/PDF Annotation APIs/CaptureEvents.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import React, { Component } from 'react'; 13 | import ViewSDKClient from '../ViewSDKClient'; 14 | import { annotations } from './Sample Annotation List/annotationList'; 15 | 16 | class CaptureEvents extends Component { 17 | viewerConfig = { 18 | /* Enable commenting APIs */ 19 | enableAnnotationAPIs: true, /* Default value is false */ 20 | }; 21 | 22 | componentDidMount() { 23 | const viewSDKClient = new ViewSDKClient(); 24 | viewSDKClient.ready().then(() => { 25 | /* Invoke the file preview and get the Promise object */ 26 | this.previewFilePromise = viewSDKClient.previewFile("pdf-div", this.viewerConfig); 27 | /* Use the annotation manager interface to invoke the commenting APIs */ 28 | this.previewFilePromise.then(adobeViewer => { 29 | adobeViewer.getAnnotationManager().then(annotationManager => { 30 | /* API to add annotations */ 31 | annotationManager.addAnnotations(annotations) 32 | .then(() => { 33 | console.log("Annotations added through API successfully"); 34 | }) 35 | .catch(error => { 36 | console.log(error); 37 | }); 38 | 39 | /* API to register events listener */ 40 | annotationManager.registerEventListener( 41 | event => { 42 | console.log(event); 43 | }, 44 | { 45 | /* Pass the list of events in listenOn. */ 46 | /* If no event is passed in listenOn, then all the annotation events will be received. */ 47 | listenOn: [ 48 | /* "ANNOTATION_ADDED", "ANNOTATION_CLICKED" */ 49 | ] 50 | } 51 | ); 52 | }); 53 | }); 54 | }); 55 | } 56 | 57 | render() { 58 | return
    ; 59 | } 60 | } 61 | 62 | export default CaptureEvents; 63 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/samples/PDF Annotation APIs/HandlingAnnotationsInPDF.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import React, { Component } from 'react'; 13 | import ViewSDKClient from '../ViewSDKClient'; 14 | import { annotations } from './Sample Annotation List/annotationList'; 15 | 16 | class HandlingAnnotationsInPDF extends Component { 17 | viewerConfig = { 18 | /* Enable commenting APIs */ 19 | enableAnnotationAPIs: true, /* Default value is false */ 20 | /* Include existing PDF annotations and save new annotations to PDF buffer */ 21 | includePDFAnnotations: true /* Default value is false */ 22 | }; 23 | 24 | componentDidMount() { 25 | const viewSDKClient = new ViewSDKClient(); 26 | viewSDKClient.ready().then(() => { 27 | /* Invoke the file preview and get the Promise object */ 28 | this.previewFilePromise = viewSDKClient.previewFile("pdf-div", this.viewerConfig); 29 | /* Use the annotation manager interface to invoke the commenting APIs */ 30 | this.previewFilePromise.then(adobeViewer => { 31 | adobeViewer.getAnnotationManager().then(annotationManager => { 32 | /* API to add annotations to PDF and return the updated PDF buffer */ 33 | /* These APIs will work only when includePDFAnnotations is set to true in viewerConfig */ 34 | annotationManager.addAnnotationsInPDF(annotations) 35 | .then(result => { 36 | console.log("Annotations added to PDF successfully and updated PDF buffer returned.", result); 37 | }) 38 | .catch(error => { 39 | console.log(error); 40 | }); 41 | 42 | /* API to remove annotations from PDF and return the updated PDF buffer along with the list of annotations */ 43 | setTimeout(() => { 44 | annotationManager.removeAnnotationsFromPDF() 45 | .then(result => { 46 | console.log("Annotations removed from PDF successfully and updated PDF buffer and annotation list returned.", result); 47 | }) 48 | .catch(error => { 49 | console.log(error); 50 | }); 51 | }, 3000); 52 | }); 53 | }); 54 | }); 55 | } 56 | 57 | render() { 58 | return
    ; 59 | } 60 | } 61 | 62 | export default HandlingAnnotationsInPDF; 63 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/samples/PDF Annotation APIs/UIConfigurations/CustomUI.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | .container { 13 | width: 100vw; 14 | height: 100vh; 15 | display: flex; 16 | } 17 | 18 | .pdf-view { 19 | width: calc(100% - 400px); 20 | } 21 | 22 | .annotations-container { 23 | border-left: 1px solid #333; 24 | width: 400px; 25 | } 26 | 27 | ul { 28 | margin: 0 5px; 29 | padding: 0; 30 | } 31 | 32 | li * { 33 | float: left; 34 | } 35 | 36 | li, h3 { 37 | clear: both; 38 | list-style: none; 39 | } 40 | 41 | input, button { 42 | outline: none; 43 | } 44 | 45 | button { 46 | background: none; 47 | border: 0px; 48 | color: #888; 49 | font-size: 15px; 50 | width: 60px; 51 | margin: 10px 0 0; 52 | font-family: Lato, sans-serif; 53 | cursor: pointer; 54 | } 55 | 56 | button:hover { 57 | color: #333; 58 | } 59 | 60 | /* Heading */ 61 | h3 { 62 | color: #333; 63 | font-weight: 700; 64 | font-size: 15px; 65 | border-bottom: 1px solid #333; 66 | padding: 15px 0 14px; 67 | margin: 0; 68 | text-align: center; 69 | text-transform: uppercase; 70 | } 71 | 72 | input[type="text"] { 73 | margin: 0; 74 | font-size: 18px; 75 | line-height: 18px; 76 | height: 18px; 77 | padding: 10px; 78 | border: 1px solid #ddd; 79 | background: #fff; 80 | border-radius: 6px; 81 | font-family: Lato, sans-serif; 82 | color: #888; 83 | } 84 | 85 | input[type="text"]:focus { 86 | color: #333; 87 | } 88 | 89 | /* Annotation list */ 90 | li { 91 | overflow: hidden; 92 | margin: 5px 0; 93 | padding: 10px 0; 94 | width: auto; 95 | border: 2px solid #3D85B0; 96 | } 97 | 98 | li > input[type="checkbox"] { 99 | margin: 0 10px; 100 | position: relative; 101 | top: 15px; 102 | } 103 | 104 | li > label { 105 | font-size: 18px; 106 | line-height: 40px; 107 | width: 237px; 108 | padding: 0 0 0 11px; 109 | } 110 | 111 | li > input[type="text"] { 112 | width: 226px; 113 | } 114 | 115 | li > .delete:hover { 116 | color: #CF2323; 117 | } 118 | 119 | .selected { 120 | border: 2px solid #3D85B0; 121 | } 122 | 123 | .unselected { 124 | border: 2px solid #eee; 125 | } 126 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/samples/PDF Annotation APIs/UIConfigurations/UIConfigurations.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import React, { Component } from "react"; 13 | import ViewSDKClient from "../../ViewSDKClient"; 14 | import CustomRHP from "./CustomRHP"; 15 | import "./CustomUI.css"; 16 | 17 | class UIConfigurations extends Component { 18 | constructor() { 19 | super(); 20 | this.state = { 21 | annotationManager: undefined 22 | }; 23 | } 24 | 25 | viewerConfig = { 26 | /* Enable commenting APIs */ 27 | enableAnnotationAPIs: true, /* Default value is false */ 28 | }; 29 | 30 | setAnnotationManager = annotManager => { 31 | this.setState({ 32 | annotationManager: annotManager 33 | }); 34 | } 35 | 36 | componentDidMount() { 37 | const viewSDKClient = new ViewSDKClient(); 38 | viewSDKClient.ready().then(() => { 39 | /* Invoke the file preview and get the Promise object */ 40 | this.previewFilePromise = viewSDKClient.previewFile("pdf-div", this.viewerConfig); 41 | /* Use the annotation manager interface to invoke the commenting APIs */ 42 | this.previewFilePromise.then(adobeViewer => { 43 | adobeViewer.getAnnotationManager().then(annotManager => { 44 | this.setAnnotationManager(annotManager); 45 | /* Set UI configurations */ 46 | const customFlags = { 47 | /* showToolbar: false, /* Default value is true */ 48 | showCommentsPanel: false, /* Default value is true */ 49 | downloadWithAnnotations: true, /* Default value is false */ 50 | printWithAnnotations: true, /* Default value is false */ 51 | }; 52 | this.state.annotationManager.setConfig(customFlags); 53 | }); 54 | }); 55 | }); 56 | } 57 | 58 | render() { 59 | return ( 60 |
    61 |
    62 | { 63 | this.state.annotationManager && 64 | 67 | } 68 |
    69 | ); 70 | } 71 | } 72 | 73 | export default UIConfigurations; 74 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/samples/PDFAnnotationTools.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import React, { Component } from "react"; 13 | import ViewSDKClient from "./ViewSDKClient"; 14 | 15 | class PDFAnnotationTools extends Component { 16 | componentDidMount() { 17 | const viewSDKClient = new ViewSDKClient(); 18 | viewSDKClient.ready().then(() => { 19 | /* Invoke file preview */ 20 | viewSDKClient.previewFile("pdf-div", { 21 | /* Control the viewer customization. */ 22 | showAnnotationTools: true, 23 | enableFormFilling: true 24 | }); 25 | /* Register Save API handler */ 26 | viewSDKClient.registerSaveApiHandler(); 27 | }); 28 | } 29 | 30 | render() { 31 | return ( 32 |
    33 | ); 34 | } 35 | } 36 | 37 | export default PDFAnnotationTools; 38 | -------------------------------------------------------------------------------- /More Samples/React Samples/src/samples/ViewerCustomization.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 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 | import React, { Component } from "react"; 13 | import ViewSDKClient from "./ViewSDKClient"; 14 | 15 | class ViewerCustomization extends Component { 16 | /* Control the viewer customization. 17 | * It lists down all supported variables with default values. 18 | **/ 19 | viewerConfig = { 20 | /* If true, tools such as sticky note, highlight, and so on appear in the quick tools menu. */ 21 | showAnnotationTools: true, 22 | 23 | /* If true, form filling is enabled and users can edit fields. */ 24 | enableFormFilling: true, 25 | 26 | /* If true, a download button appears in the overflow menu on the top bar. */ 27 | showDownloadPDF: true, 28 | 29 | /* If true, then a print PDF option appears in the overflow menu on the top bar. */ 30 | showPrintPDF: true, 31 | 32 | /* If true, the zoom controls are displayed on the right hand panel. */ 33 | showZoomControl: true, 34 | 35 | /* Allowed possible values are 'FIT_PAGE', 'FIT_WIDTH', 'TWO_COLUMN', 'TWO_COLUMN_FIT_PAGE', or ''. 36 | FIT_WIDTH expands the page horizontally to the full width of the document pane. 37 | FIT_PAGE displays the entire page in the current view so that no scrolling is required. 38 | TWO_COLUMN displays two pages side-by-side in the current view. 39 | TWO_COLUMN_FIT_PAGE displays two pages side-by-side where the pages are zoomed to page level. 40 | Note that end users can toggle the view mode on the right hand panel. */ 41 | defaultViewMode: '' 42 | }; 43 | 44 | componentDidMount() { 45 | const viewSDKClient = new ViewSDKClient(); 46 | viewSDKClient.ready().then(() => { 47 | /* Invoke file preview */ 48 | viewSDKClient.previewFile("pdf-div", this.viewerConfig); 49 | }); 50 | } 51 | 52 | render() { 53 | return
    ; 54 | } 55 | } 56 | 57 | export default ViewerCustomization; 58 | -------------------------------------------------------------------------------- /More Samples/Save User Preferences/README.md: -------------------------------------------------------------------------------- 1 | # Save User Preferences Sample 2 | 3 | PDF Embed API does not save any user preferences by default. This sample demonstrates how certain user preferences (such as updated annotation colour, and coach mark after selecting any annotation tool) can be saved and remembered in the browser. 4 | In this example, the user preferences are saved in the local storage of the website domain. 5 | 6 | To see it in action, copy the files in the folder to your computer, and open index.html in a supported browser. 7 | 8 | ## Documentation 9 | 10 | For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs. 11 | -------------------------------------------------------------------------------- /More Samples/Save User Preferences/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 |
    12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /More Samples/Save User Preferences/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 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 Acrobat Services PDF Embed API 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: "", 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://acrobatservices.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: "", 34 | 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 | /* Handler to store the user preferences */ 48 | var setUserSettingHandler = function (setting) { 49 | return new Promise(function (resolve, reject) { 50 | /* This is an example code, where the user preferences are saved in the local storage of the website domain. 51 | Replace this with your own custom implementation of saving the preferences. */ 52 | console.log("Setting user preferences in local storage of website domain.") 53 | localStorage.setItem("USER_SETTINGS", JSON.stringify(setting)); 54 | var response = { 55 | code: AdobeDC.View.Enum.ApiResponseCode.SUCCESS, 56 | }; 57 | resolve(response); 58 | }); 59 | }; 60 | 61 | adobeDCView.registerCallback( 62 | AdobeDC.View.Enum.CallbackType.SET_USER_SETTING_API, 63 | setUserSettingHandler, 64 | {} 65 | ); 66 | 67 | /* Handler to fetch the user preferences */ 68 | var getUserSettingHandler = function () { 69 | return new Promise(function (resolve, reject) { 70 | /* This is an example code to fetch the user preferences. Replace with your own custom implementation. */ 71 | console.log("Fetching user preferences from local storage of website domain.") 72 | var userSettings = localStorage.getItem("USER_SETTINGS") || "{}"; 73 | userSettings = JSON.parse(userSettings); 74 | var response = { 75 | code: AdobeDC.View.Enum.ApiResponseCode.SUCCESS, 76 | data: { 77 | setting: userSettings 78 | } 79 | }; 80 | resolve(response); 81 | }); 82 | }; 83 | 84 | adobeDCView.registerCallback( 85 | AdobeDC.View.Enum.CallbackType.GET_USER_SETTING_API, 86 | getUserSettingHandler, 87 | {} 88 | ); 89 | }); 90 | -------------------------------------------------------------------------------- /More Samples/Viewer APIs/Attachment APIs/README.md: -------------------------------------------------------------------------------- 1 | # Sample for Attachment APIs 2 | 3 | This sample shows how to access the file attachments available in the PDF. 4 | 5 | A custom left hand pane has been created. Upload a PDF file from local storage and the attachments available in the PDF are listed in this pane. 6 | Click on any attachment link to download the particular attachment to your computer. 7 | 8 | To see it in action, copy the files in the folder to your computer, and open index.html in a supported browser. 9 | 10 | ## Documentation 11 | 12 | For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs. 13 | -------------------------------------------------------------------------------- /More Samples/Viewer APIs/Attachment APIs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
    13 |

    Attachments

    14 |
    15 |
    16 |
    17 | 18 | 19 |
    20 |
    21 | 22 | 23 |
    24 | 25 | -------------------------------------------------------------------------------- /More Samples/Viewer APIs/Attachment APIs/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 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 | body { 13 | margin: 0; 14 | display: flex; 15 | height: 100vh; 16 | } 17 | 18 | #adobe-dc-view { 19 | width: calc(100% - 300px); 20 | } 21 | 22 | h3 { 23 | margin-top: 40px; 24 | } 25 | 26 | #attachment-pane { 27 | border-right: 1px solid grey; 28 | font-size: 15px; 29 | float: left; 30 | padding: 15px; 31 | width: 300px; 32 | background-color: #f5f5f5; 33 | text-align: center; 34 | } 35 | 36 | ul { 37 | list-style-type: disc; 38 | text-align: left; 39 | margin: 0; 40 | } 41 | 42 | li { 43 | cursor: pointer; 44 | font-family: Lato, sans-serif; 45 | color: #777; 46 | font-size: medium; 47 | } -------------------------------------------------------------------------------- /More Samples/Viewer APIs/Bookmark APIs/README.md: -------------------------------------------------------------------------------- 1 | # Sample for Bookmark APIs 2 | 3 | This sample shows how to fetch and open bookmarks in the PDF programmatically. 4 | 5 | A custom left hand pane has been created. Upload a PDF file from local storage and the bookmarks available in the PDF are listed in this pane. 6 | Click on any bookmark link to navigate to the particular PDF page containing that bookmark. 7 | 8 | To see it in action, copy the files in the folder to your computer, and open index.html in a supported browser. 9 | 10 | ## Documentation 11 | 12 | For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs. 13 | -------------------------------------------------------------------------------- /More Samples/Viewer APIs/Bookmark APIs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
    13 |

    Bookmarks

    14 |
    15 |
    16 |
    17 | 18 | 19 |
    20 |
    21 | 22 | 23 |
    24 | 25 | -------------------------------------------------------------------------------- /More Samples/Viewer APIs/Bookmark APIs/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 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 | body { 13 | margin: 0; 14 | display: flex; 15 | height: 100vh; 16 | } 17 | 18 | #adobe-dc-view { 19 | width: calc(100% - 300px); 20 | } 21 | 22 | h3 { 23 | margin-top: 40px; 24 | } 25 | 26 | #bookmark-pane { 27 | border-right: 1px solid grey; 28 | font-size: 15px; 29 | float: left; 30 | padding: 15px; 31 | width: 300px; 32 | background-color: #f5f5f5; 33 | text-align: center; 34 | } 35 | 36 | ul { 37 | list-style-type: disc; 38 | text-align: left; 39 | margin: 0; 40 | } 41 | 42 | li { 43 | cursor: pointer; 44 | font-family: Lato, sans-serif; 45 | color: #777; 46 | font-size: medium; 47 | } -------------------------------------------------------------------------------- /More Samples/Viewer APIs/README.md: -------------------------------------------------------------------------------- 1 | # Viewer APIs 2 | 3 | PDF Embed API provides viewer APIs for customizing the user interface and user interactions with the PDF. 4 | These samples show how these APIs can be used to perform UI customizations programmatically at run-time. 5 | 6 | ### Attachment APIs 7 | 8 | This sample shows how to access the file attachments available in the PDF. 9 | To see it in action, open ```Attachment APIs/index.html``` in a supported browser. 10 | 11 | ### Bookmark APIs 12 | 13 | This sample shows how to fetch and open bookmarks in the PDF programmatically. 14 | To see it in action, open ```Bookmark APIs/index.html``` in a supported browser. 15 | 16 | ### Search and Zoom APIs 17 | 18 | This sample shows how to perform search and zoom operations on the PDF programmatically using the Search and Zoom Viewer APIs. 19 | Search APIs will search for a term in a PDF and traverse through the search results. 20 | Zoom APIs will perform zoom operations on the PDF. 21 | To see it in action, open ```Search and Zoom APIs/index.html``` in a supported browser. 22 | 23 | ## Documentation 24 | 25 | For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs. 26 | -------------------------------------------------------------------------------- /More Samples/Viewer APIs/Search and Zoom APIs/README.md: -------------------------------------------------------------------------------- 1 | # Sample for Search and Zoom APIs 2 | 3 | This sample shows how to perform search and zoom operations on the PDF programmatically using the Search and Zoom Viewer APIs. 4 | 5 | ### Search APIs 6 | 7 | A custom search bar has been created which can be used to enter any term. Click on the search button to search for that term in the PDF and traverse through the search results. Click on the Clear button to cancel the search operation. 8 | 9 | ### Zoom APIs 10 | 11 | Custom zoom controls have been created which can be used to increase and decrease the PDF zoom level. 12 | To set a particular zoom level, enter the value in the box and the page view changes according to the zoom level. 13 | 14 | To see the APIs in action, copy the files in the folder to your computer, and open index.html in a supported browser. 15 | 16 | ## Documentation 17 | 18 | For detailed documentation, please check https://www.adobe.com/go/dcviewsdk_docs. 19 | -------------------------------------------------------------------------------- /More Samples/Viewer APIs/Search and Zoom APIs/images/chevronnext.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /More Samples/Viewer APIs/Search and Zoom APIs/images/chevronprevious.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /More Samples/Viewer APIs/Search and Zoom APIs/images/zoom_in.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /More Samples/Viewer APIs/Search and Zoom APIs/images/zoom_out.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /More Samples/Viewer APIs/Search and Zoom APIs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |
    15 | 16 | 17 | 18 |
    19 |
    20 | Result 0 of 0 21 | 22 | 23 |
    24 | 25 |
    26 | PDF Zoom Level 27 |
    28 | 29 | 30 | 31 |
    32 |
    33 |
    34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /More Samples/Viewer APIs/Search and Zoom APIs/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 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 | body { 13 | margin: 0; 14 | display: flex; 15 | height: 100vh; 16 | } 17 | 18 | .pdf-view { 19 | width: calc(100% - 300px); 20 | } 21 | 22 | .container { 23 | border-left: 1px solid #333; 24 | width: 300px; 25 | font-family: Lato, sans-serif; 26 | text-align: center; 27 | background-color: #f5f5f5; 28 | } 29 | 30 | input[type="text"] { 31 | margin: 0; 32 | font-size: 15px; 33 | line-height: 15px; 34 | height: 15px; 35 | padding: 10px; 36 | border: 1px solid #ddd; 37 | background: #fff; 38 | border-radius: 6px; 39 | font-family: Lato, sans-serif; 40 | color: #606060; 41 | width: 100%; 42 | } 43 | 44 | input[type="text"]:focus { 45 | color: #333; 46 | } 47 | 48 | .search-container { 49 | padding: 6px 10px; 50 | margin-top: 5px; 51 | margin-right: 16px; 52 | border: none; 53 | cursor: pointer; 54 | } 55 | 56 | .btn { 57 | background-color: #c3c5c3; 58 | border: none; 59 | color: black; 60 | padding: 10px 15px; 61 | text-align: center; 62 | text-decoration: none; 63 | display: inline-block; 64 | font-size: 16px; 65 | margin: 20px 5px; 66 | cursor: pointer; 67 | } 68 | 69 | #search-result { 70 | padding: 6px 10px; 71 | margin: 20px 5px; 72 | display: none; 73 | } 74 | 75 | #searchResult-num { 76 | color: #606060; 77 | position: relative; 78 | top: -2px; 79 | } 80 | 81 | .searchResult-btn { 82 | margin-left: 10px; 83 | opacity: 0.2; 84 | border: 0; 85 | background: none; 86 | cursor: pointer; 87 | } 88 | 89 | #zoom-level { 90 | position: absolute; 91 | bottom: 0; 92 | padding: 6px 10px; 93 | margin: 20px 5px; 94 | font-size: 17px; 95 | border: none; 96 | cursor: pointer; 97 | } 98 | 99 | input[id="set-zoom"] { 100 | width: 20%; 101 | margin: 5px; 102 | text-align: center; 103 | } 104 | 105 | .zoom-btn { 106 | border: 0; 107 | background: none; 108 | cursor: pointer; 109 | } 110 | -------------------------------------------------------------------------------- /More Samples/Viewer Customization/README.md: -------------------------------------------------------------------------------- 1 | # Customize PDF Preview Sample 2 | 3 | This sample shows how to customize the 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. 9 | -------------------------------------------------------------------------------- /More Samples/Viewer Customization/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 |
    12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /More Samples/Viewer Customization/index.js: -------------------------------------------------------------------------------- 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 | /* Control the viewer customization. 13 | * It lists down all supported variables with default values. 14 | **/ 15 | var viewerConfig = { 16 | showAnnotationTools: true, 17 | enableFormFilling: true, 18 | showDownloadPDF: true, 19 | showPrintPDF: true, 20 | showZoomControl: true, 21 | defaultViewMode: "", /* Allowed possible values are "FIT_PAGE", "FIT_WIDTH", "TWO_COLUMN", "TWO_COLUMN_FIT_PAGE" or "". */ 22 | }; 23 | 24 | /* Wait for Adobe Acrobat Services PDF Embed API to be ready */ 25 | document.addEventListener("adobe_dc_view_sdk.ready", function () { 26 | /* Initialize the AdobeDC View object */ 27 | var adobeDCView = new AdobeDC.View({ 28 | /* Pass your registered client id */ 29 | clientId: "", 30 | /* Pass the div id in which PDF should be rendered */ 31 | divId: "adobe-dc-view", 32 | }); 33 | 34 | /* Invoke the file preview API on Adobe DC View object */ 35 | adobeDCView.previewFile({ 36 | /* Pass information on how to access the file */ 37 | content: { 38 | /* Location of file where it is hosted */ 39 | location: { 40 | url: "https://acrobatservices.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf", 41 | /* 42 | If the file URL requires some additional headers, then it can be passed as follows:- 43 | headers: [ 44 | { 45 | key: "", 46 | value: "", 47 | } 48 | ] 49 | */ 50 | }, 51 | }, 52 | /* Pass meta data of file */ 53 | metaData: { 54 | /* file name */ 55 | fileName: "Bodea Brochure.pdf" 56 | } 57 | }, viewerConfig); 58 | }); 59 | -------------------------------------------------------------------------------- /More Samples/Work with Local File/README.md: -------------------------------------------------------------------------------- 1 | # Local PDF file Preview Sample 2 | 3 | This sample demonstrates how to render a local PDF file using the PDF Embed API. It will ask you to pick a PDF file from your computer to start the PDF file rendering using the PDF Embed API. 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. 9 | -------------------------------------------------------------------------------- /More Samples/Work with Local File/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 |
    12 |
    13 | 14 | 15 |
    16 |
    17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /More Samples/Work with Local File/index.js: -------------------------------------------------------------------------------- 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 | /* Helper function to render the file using PDF Embed API. */ 13 | function previewFile(filePromise, fileName) { 14 | /* Initialize the AdobeDC View object */ 15 | var adobeDCView = new AdobeDC.View({ 16 | /* Pass your registered client id */ 17 | clientId: "", 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 | /* pass file promise which resolve to arrayBuffer */ 27 | promise: filePromise, 28 | }, 29 | /* Pass meta data of file */ 30 | metaData: { 31 | /* file name */ 32 | fileName: fileName 33 | } 34 | }, {}); 35 | } 36 | 37 | /* Helper function to check if selected file is PDF or not. */ 38 | function isValidPDF(file) { 39 | if (file.type === "application/pdf") { 40 | return true; 41 | } 42 | if (file.type === "" && file.name) { 43 | var fileName = file.name; 44 | var lastDotIndex = fileName.lastIndexOf("."); 45 | return !(lastDotIndex === -1 || fileName.substr(lastDotIndex).toUpperCase() !== "PDF"); 46 | } 47 | return false; 48 | } 49 | 50 | /* Helper function to listen for file upload and 51 | * creating Promise which resolve to ArrayBuffer of file data. 52 | **/ 53 | function listenForFileUpload() { 54 | var fileToRead = document.getElementById("file-picker"); 55 | fileToRead.addEventListener("change", function (event) { 56 | var files = fileToRead.files; 57 | if (files.length > 0 && isValidPDF(files[0])) { 58 | var fileName = files[0].name; 59 | var reader = new FileReader(); 60 | reader.onloadend = function (e) { 61 | var filePromise = Promise.resolve(e.target.result); 62 | previewFile(filePromise, fileName); 63 | }; 64 | reader.readAsArrayBuffer(files[0]); 65 | } 66 | }, false); 67 | } 68 | -------------------------------------------------------------------------------- /Sized Container Embed Mode/README.md: -------------------------------------------------------------------------------- 1 | # Sized Container Embed Mode Sample 2 | 3 | PDF viewer is embedded in the sized container in slideshow and landscape mode. 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. 9 | -------------------------------------------------------------------------------- /Sized Container Embed Mode/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adobe Acrobat Services PDF Embed API Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
    13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Sized Container Embed Mode/index.js: -------------------------------------------------------------------------------- 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 | var viewerConfig = { 14 | embedMode: "SIZED_CONTAINER" 15 | }; 16 | 17 | /* Wait for Adobe Acrobat Services PDF Embed API 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: "", 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://acrobatservices.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: "", 39 | 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 | }); 52 | --------------------------------------------------------------------------------