How do I enable annotations tools on the PWS WebViewer?

Skip to first unread message

Kevin Kuo

Apr 12, 2016, 7:43:41 PM4/12/16
to PDFTron WebViewer
Q: How do I enable annotations (to show the annotation creation tools) on the PWS WebViewer?

A: If you are using the a custom config script, you can do the following:

if (window.location.href.indexOf('&a=1') === -1) {
.location.href += '&a=1';

Alternative, you can use the PWS API's view method in non-redirect mode. The response will be in xml containing the temporary viewer URL, which you can then append "&a=1" before redirecting to it.

Note that PWS WebViewer disables annotations by default because annotation saving and loading is application logic that should be handled by your own server. Just by enabling this flag, the tools will allow you to create annotations, however, they will not be persisted. For an example of how to save annotations, see the annotationHandler.php in the WebViewer download package.
Reply all
Reply to author
0 new messages