diff --git a/src/core.js b/src/core.js index f8556a3da..7a883195a 100644 --- a/src/core.js +++ b/src/core.js @@ -538,11 +538,8 @@ var PDFDocument = (function PDFDocumentClosure() { return shadow(this, 'numPages', num); }, getDocumentInfo: function PDFDocument_getDocumentInfo() { - var encrypt = this.xref.encrypt; var docInfo = { PDFFormatVersion: this.pdfFormatVersion, - IsTextCopyDisabled: encrypt ? encrypt.disableTextCopy : false, - IsPrintDisabled: encrypt ? encrypt.disablePrint : false, IsAcroFormPresent: !!this.acroForm }; if (this.xref.trailer.has('Info')) { diff --git a/src/crypto.js b/src/crypto.js index 76cee2691..d9a8f98cb 100644 --- a/src/crypto.js +++ b/src/crypto.js @@ -561,8 +561,6 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() { var ownerPassword = stringToBytes(dict.get('O')); var userPassword = stringToBytes(dict.get('U')); var flags = dict.get('P'); - this.disableTextCopy = !(flags & 16); - this.disablePrint = !(flags & 4); var revision = dict.get('R'); var encryptMetadata = algorithm == 4 && // meaningful when V is 4 dict.get('EncryptMetadata') !== false; // makes true as default value diff --git a/web/viewer.css b/web/viewer.css index fb771f286..0a034e2a7 100644 --- a/web/viewer.css +++ b/web/viewer.css @@ -1198,14 +1198,6 @@ canvas { background-color: rgba(0, 100, 0, 0.2); } -#viewerContainer.copy-protection .textLayer > div { - visibility: hidden; -} - -#viewerContainer.copy-protection .textLayer > div > .highlight { - visibility: visible; -} - /* TODO: file FF bug to support ::-moz-selection:window-inactive so we can override the opaque grey background when the window is inactive; see https://bugzilla.mozilla.org/show_bug.cgi?id=706209 */ @@ -1358,10 +1350,6 @@ canvas { margin: 0; } - #viewerContainer.print-protection { - display: none; - } - .page { float: left; display: none; diff --git a/web/viewer.js b/web/viewer.js index d631dbe13..184528c43 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -1352,28 +1352,6 @@ var PDFView = { // AcroForm/XFA was found PDFView.fallback(); } - - if (info.IsTextCopyDisabled) { - document.getElementById('viewerContainer').classList - .add('copy-protection'); - } else { - document.getElementById('viewerContainer').classList - .remove('copy-protection'); - } - - if (info.IsPrintDisabled) { - if (PDFView.supportsPrinting) { - document.getElementById('print').classList.add('hidden'); - } - document.getElementById('viewerContainer').classList - .add('print-protection'); - } else { - if (PDFView.supportsPrinting) { - document.getElementById('print').classList.remove('hidden'); - } - document.getElementById('viewerContainer').classList - .remove('print-protection'); - } }); }, @@ -1640,9 +1618,6 @@ var PDFView = { }, beforePrint: function pdfViewSetupBeforePrint() { - if (this.documentInfo.IsPrintDisabled) { - return; - } if (!this.supportsPrinting) { var printMessage = mozL10n.get('printing_not_supported', null, 'Warning: Printing is not fully supported by this browser.');