Installing WebViewer
Aiiimi Workplace AI uses WebViewer to preview items within the application. This is a step by step guide on installing and configuring it.
Install and Configure PDFTron
Install Wizard
Open your file explorer and navigate to your downloads.
Run the "WebViewer-Server-Windows-x64.exe" file.
This will open the WebViewer Setup Wizard
Read and review the license agreement.
If you are comfortable to progress accept the conditions and select next.
Leave the selected components as default and select next.
Make sure "Install WebViewer Server as a Windows service" is checked and select next.
On the summary screen select install.
The summary screen should have the setup type, selected components and additional tasks.

Configuration Wizard
Once the install has finished there are couple of configurations steps.
On the configuration intro page select next.
On the Configurations 1/2 step enter your PDFNet license.
Select next.
On the Configurations 2/2 step check TRN_FORWARD_CLIENT_COOKIES.
Select next.
Make a note of the config file path as this will need editing soon.

Select Finish.
Config File
Open your file explorer and navigate to the config file path from before.
eg. C:\WebViewer-Server/apache-tomcat
Right click the wvs_config.json file and select edit in Notepad++.
Ensure the license entered before is in the "TRN_PDFNET_KEY".
Change the following settings to true.
With these enabled, when a result preview is closed the WebViewerServer renders the preview inaccessible. Even if users have a direct URL to the WebViewer generated version.
"TRN_ENABLE_SESSION_AUTH":"true",
"TRN_ENABLE_PER_SESSION_CACHING":"true",Add the following line above the variables comment.
"TRN_DISABLE_VALIDATION":"true",
Save and exit Notepad++.
PDFTron Check
Now that PDFTRON is installed and configured check you can it's running and working correctly.
Open your services manager and find the service WebViewer-Server.
If it's not running, start the service. We recommend setting this service starts automatically if it isn't already.
To check if PDFTron is working open your browser and navigate to http://localhost:8090/demo.
Upload a pdf. or docx. file and make sure it displays correctly.
If it does not display correctly, try removing the WebViewer-Server and starting again.
Control Hub Activation
Update the license key in Control Hub to allow for smooth communication between WebViewer and Workplace AI.
Go to your browser and Login to the Control Hub.
Navigate to Viewer within Global Settings.
Under the Viewer License Key enter the license you entered before.

Select save changes.
Open PowerShell as administrator and run the following script.
Install URL ReWrite and Redirect
Installing URL ReWrite and URL Redirect allows PDFTron to work with Workplace AI via preview request redirects.
Open your file explorer and navigate to your downloads.
Run the URL redirect installer "requestRouter_amd64.msi".
Run the URL ReWrite installer "rewrite_amd64_en-US.msi".
IIS Server Features
On your server, open the server manager.
Select Add roles and features.
Select Next until you get to the Server Rules page.
On the Server Rules page expand Web Server (IIS) > Web Server.
Check 'WebSocket Protocol (Installed)' and select next.
Select Install and Close.
If you can't see the 'application request routing' or 'URL rewrite' in IIS restart your server.
IIS Configuration
Server Variables
Open Internet Information Services (IIS) Manager on your server.
Select the server name and open Application Request Routing.
Check the 'Enable proxy' setting and select apply in the actions menu on the right.
Expand the sites on the server and select Default Web Site.
Open the URL Rewrite.
Select View Server Variables in the actions menu on the right.
Select Add in the actions menu on the right.
In the server variable name enter "HTTP_SEC_WEBSOCKET_EXTENSIONS" and select OK.
Add Rules
Go back to the default website and open URL rewrite.
Select Add Rule in the actions menu on the right.
Select Blank rule and enter the following information.
Name - pdftron
Pattern - ^pdftron/(.*)

Under Conditions select Add and enter the following information.
Condition input - {CACHE_URL}.
Pattern - ^(.+)://

Select OK.
Under Variables select Add and enter the following information.
Server variable name - Select the variable setup previously.
Value - a
This will be updated later so can be anything for now.

Under Action select rewrite from the dropdown and enter the following information.
Rewrite URL - http://localhost:8090/{R:1}
You can test the configuration from the conditions section before applying it.
Under conditions double click the CACHE_URL condition.
Select Test Pattern and enter the following.
Input data to test - http://insightmaker/pdftron/something.
Select Test.
If you see green ticks everything is correct and you can close the test.
Select Apply from the actions menu on the right.
Web Configuration
There are a number of settings that need to be adapted within the web configuration document to allow connections to be established.
Open the file explorer and navigate to C:\InsightMaker\Apps\Search\app
Right click the web.default.config file and edit it with notepad++.
Also right click the web.config file and edit it with notepad++.
Copy the entire contents of web.default.config to web.config.
In the web.config file make sure the HTTP_SEC_WEBSOCKET_EXTENSIONS value is blank.
Save both files and close notepad++.
Open PowerShell as an Administrator and run the following script.
Test PDFTron
Login to the Workplace AI search application.
Search for a pdf, docx or xlsx document and select preview on the file.
A preview of this item should appear. It may take a few seconds to load for the first time and longer depending on the size of the file.
Last updated