Skip to main content

Web Collaboration Client

Getting Started

Installation

npm install @foxitsoftware/web-collab-client

Integration

This section will walk you through getting Web Collaboration Client module integrated into a web application based on Foxit PDF SDK for Web.

1)Import the collaboration client module and Foxit PDF SDK for Web.

import PDFViewer from ' @foxitsoftware/PDFViewerCtrl' 
import { WebCollabClient } from ' @foxitsoftware/web-collab-client'

2)Initialize PDFViewer. For more information, please refer to the Developer Guide of Foxit PDF SDK for Web.

var PDFViewer = PDFViewCtrl.PDFViewer;
var pdfViewer = new PDFViewer({
libPath: './lib', // the library path of Web SDK.
jr: {
licenseSN: licenseSN,
licenseKey: licenseKey,
}
});
pdfViewer.init('#pdf-viewer'); // the div (id="pdf-viewer")

3)Create a new instance of the collaboration client:

import { WebCollabClient } from ' @foxitsoftware/web-collab-client'
const webCollabClient = new WebCollabClient({
pdfViewer: pdfViewer,
baseURL:`http://localhost:8080`,
userProvider: () => {
return {
id: 'userId',
username: 'userName',
token: 'usertoken'
}
}
});
  • options.pdfViewer: The Web SDK basic webViewer instance
  • options.baseURL: The base URL of the collaboration server component
  • options.userProvider: The user service

For a full list of constructor options, please see the Web Collaboration Client API reference.

Now, you have finished the integration of collaboration client. Next, you can create and begin the collaboration.