Integrate WebViewer into Microsoft Teams

Sample integrates WebViewer into a Microsoft Teams project using a basic tab template.

WebViewer provides a slick out-of-the-box responsive UI that enables you to view, annotate and manipulate PDFs and other document types inside any web project.

Click the button below to view the full project in GitHub.

1WebViewer({
2 path: '/static/lib/public', // path to the Apryse 'public' folder on your server
3 licenseKey: 'YOUR_LICENSE_KEY', // sign up to get a key at https://dev.apryse.com
4 initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/webviewer-demo.pdf',
5 // initialDoc: '/path/to/my/file.pdf', // You can also use documents on your server
6}, document.getElementById('viewer'))
7.then(instance => {
8 const { documentViewer, annotationManager } = instance.Core;
9
10 // call methods from instance, documentViewer and annotationManager as needed
11
12 // you can also access major namespaces from the instance as follows:
13 // const Tools = instance.Core.Tools;
14 // const Annotations = instance.Core.Annotations;
15
16 documentViewer.addEventListener('documentLoaded', () => {
17 // call methods relating to the loaded document
18 });
19});
20

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales