LP#1986725: restore portrait/landscape choice when printing from Angular user/gmcharlt/lp1986725_choose_landscape_mode
authorGalen Charlton <gmc@equinoxOLI.org>
Fri, 9 Sep 2022 15:22:46 +0000 (11:22 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 9 Sep 2022 15:28:58 +0000 (11:28 -0400)
This patch works around a default setting in Bootstrap 4 that specifies
A3 as the paper size for printing. Specifying any paper size like this
causes Chrome and Firefox to stop offering the users the option to
choose the paper orientation.

My testing suggests that specifying A3 as the default paper size also
resulted in the printed text using a smaller font size when printing
on US paper sizes. Some sort of scaling down from A3 to letter,
perhaps.

To test
-------
[1] Open the Angular Holds Pull List, select a branch that has items
    to pull, and click the Print Full List button. Observe that the
    browser print dialog does not offer an option to choose the
    orientation.
[2] As above, but for any Angular grid's Print Full Grid action.
[3] Apply the patch and repeat 1 and 2. This time, the browser print
    dialog should offer the option to select the orientation.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/styles.css

index cc4006d..d5d930e 100644 (file)
@@ -207,6 +207,11 @@ h5 {font-size: .95rem}
   head {display: none} /* just to be safe */
   body div:not([id="eg-print-container"]) {display: none}
   div {display: none}
+  @page {size: auto} /* work around Bootrap 4's default
+                        of A3; specifying any paper
+                        size stops browsers from letting
+                        the user choose portrait or
+                        landscape. LP#1986725 */
   #eg-print-container {display: block}
   #eg-print-container div {display: block}
   #eg-print-container pre {border: none}