diff --git a/l10n/en-US/viewer.properties b/l10n/en-US/viewer.properties
index de6fd95db..1c4dd1cde 100644
--- a/l10n/en-US/viewer.properties
+++ b/l10n/en-US/viewer.properties
@@ -87,3 +87,5 @@ loading_error=An error occurred while loading the PDF.
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
text_annotation_type=[{{type}} Annotation]
request_password=PDF is protected by a password:
+
+printing_not_supported=Warning: Printing is not fully supported by this browser.
diff --git a/web/viewer.css b/web/viewer.css
index b8e86f2c8..80a8c5a40 100644
--- a/web/viewer.css
+++ b/web/viewer.css
@@ -1113,7 +1113,16 @@ canvas {
font-size: 10px;
}
+@page {
+ margin: 0;
+}
+
+#printContainer {
+ display: none;
+}
+
@media print {
+ /* Rules for browsers that don't support mozPrintCallback. */
#sidebarContainer, .toolbar, #loadingBox, #errorWrapper, .textLayer {
display: none;
}
@@ -1135,6 +1144,19 @@ canvas {
.page[data-loaded] {
display: block;
}
+
+ /* Rules for browsers that support mozPrintCallback */
+ body[data-mozPrintCallback] #outerContainer {
+ display: none;
+ }
+ body[data-mozPrintCallback] #printContainer {
+ display: block;
+ }
+ #printContainer canvas {
+ position: relative;
+ top: 0;
+ left: 0;
+ }
}
@media all and (max-width: 950px) {
diff --git a/web/viewer.html b/web/viewer.html
index c59d9fcf3..28e57f700 100644
--- a/web/viewer.html
+++ b/web/viewer.html
@@ -102,11 +102,9 @@
Open
-