mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Implements the print permission
This commit is contained in:
parent
51c81a1d01
commit
729b82359a
4 changed files with 23 additions and 0 deletions
|
@ -542,6 +542,7 @@ var PDFDocument = (function PDFDocumentClosure() {
|
|||
var docInfo = {
|
||||
PDFFormatVersion: this.pdfFormatVersion,
|
||||
IsTextCopyDisabled: encrypt ? encrypt.disableTextCopy : false,
|
||||
IsPrintDisabled: encrypt ? encrypt.disablePrint : false,
|
||||
IsAcroFormPresent: !!this.acroForm
|
||||
};
|
||||
if (this.xref.trailer.has('Info')) {
|
||||
|
|
|
@ -562,6 +562,7 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue