How to use Viewer to View Password protected PDF files

34 views
Skip to first unread message

chhaya...@infinxinc.com

unread,
Nov 16, 2017, 11:55:13 AM11/16/17
to PDFTron WebViewer
I have password protected PDF files, which I want to show through my asp.net application. The Password would be provided through code. User should not get prompt to enter password. These files should only be viewed through application. The user should not able save/download or print or copy text from the PDF.

Justin Jung

unread,
Nov 17, 2017, 3:05:34 PM11/17/17
to PDFTron WebViewer

For disabling those webviewer features, you can add the following to config.js:

$(document).on('viewerLoaded', function() {
  $('#PDFDownloadButtonContainer').hide();
  $('#OfficeDownloadButtonContainer').hide();
  $('#printButton').hide();
  readerControl.print = function() {};
  readerControl.enableCopyAndTextSelection(false);
});

Justin Jung
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages