mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Implements the print permission
This commit is contained in:
parent
51c81a1d01
commit
729b82359a
4 changed files with 23 additions and 0 deletions
|
@ -1360,6 +1360,20 @@ var PDFView = {
|
|||
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');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -1626,6 +1640,9 @@ 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.');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue