Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that pdfDocument is defined when printing (issue 6083) #6086

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions web/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1094,14 +1094,14 @@ var PDFViewerApplication = {
beforePrint: function pdfViewSetupBeforePrint() {
if (!this.supportsPrinting) {
var printMessage = mozL10n.get('printing_not_supported', null,
'Warning: Printing is not fully supported by this browser.');
'Warning: Printing is not fully supported by this browser.');
this.error(printMessage);
return;
}

var alertNotReady = false;
var i, ii;
if (!this.pagesCount) {
if (!this.pdfDocument || !this.pagesCount) {
alertNotReady = true;
} else {
for (i = 0, ii = this.pagesCount; i < ii; ++i) {
Expand All @@ -1113,7 +1113,7 @@ var PDFViewerApplication = {
}
if (alertNotReady) {
var notReadyMessage = mozL10n.get('printing_not_ready', null,
'Warning: The PDF is not fully loaded for printing.');
'Warning: The PDF is not fully loaded for printing.');
window.alert(notReadyMessage);
return;
}
Expand All @@ -1125,8 +1125,8 @@ var PDFViewerApplication = {
body.setAttribute('data-mozPrintCallback', true);

if (!this.hasEqualPageSizes) {
console.warn('Not all pages have the same size. The printed result ' +
'may be incorrect!');
console.warn('Not all pages have the same size. ' +
'The printed result may be incorrect!');
}

// Insert a @page + size rule to make sure that the page size is correctly
Expand Down