text_annotation_type=[{{type}} Annotation]
request_password=PDF is protected by a password:
-printing_not_supported=Warning: Printing is not supported by this browser.
+printing_not_supported=Warning: Printing is not fully supported by this browser.
}
@media print {
- #outerContainer {
+ /* Rules for browsers that don't support mozPrintCallback. */
+ #sidebarContainer, .toolbar, #loadingBox, #errorWrapper, .textLayer {
display: none;
}
- #printContainer {
+
+ #mainContainer, #viewerContainer, .page, .page canvas {
+ position: static;
+ padding: 0;
+ margin: 0;
+ }
+
+ .page {
+ float: left;
+ display: none;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+ }
+
+ .page[data-loaded] {
+ display: block;
+ }
+
+ /* Rules for browsers that support mozPrintCallback */
+ body[data-mozPrintCallback] #outerContainer {
+ display: none;
+ }
+ body[data-mozPrintCallback] #printContainer {
display: block;
}
- canvas {
+ #printContainer canvas {
position: relative;
top: 0;
left: 0;
get supportsPrinting() {
var canvas = document.createElement('canvas');
- return 'mozPrintCallback' in canvas;
+ var value = 'mozPrintCallback' in canvas;
+ // shadow
+ Object.defineProperty(this, 'supportsPrinting', { value: value,
+ enumerable: true,
+ configurable: true,
+ writable: false });
+ return value;
},
open: function pdfViewOpen(url, scale, password) {
beforePrint: function pdfViewSetupBeforePrint() {
if (!this.supportsPrinting) {
var printMessage = mozL10n.get('printing_not_supported', null,
- 'Warning: Printing is not supported by this browser.');
+ 'Warning: Printing is not fully supported by this browser.');
alert(printMessage);
return;
}
+ var body = document.querySelector('body');
+ body.setAttribute('data-mozPrintCallback', true);
for (var i = 0, ii = this.pages.length; i < ii; ++i) {
this.pages[i].beforePrint();
}
console.error(error);
// Tell the printEngine that rendering this canvas/page has failed.
// This will make the print proces stop.
- obj.abort();
+ if ('abort' in object)
+ obj.abort();
+ else
+ obj.done();
+ self.pdfPage.destroy();
});
};
};