Open Bug 1807701 Opened 3 years ago Updated 11 days ago

Change default paper size to A4

Categories

(Firefox for Android :: General, enhancement)

All
Android
enhancement

Tracking

()

ASSIGNED

People

(Reporter: schnusch, Assigned: cswilson252)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0

Steps to reproduce:

Use Firefox for Android's "Save as PDF".

Actual results:

The produced PDF has US letter paper size.

Expected results:

The A4 is internationally standardized and more widely used, see https://en.wikipedia.org/wiki/Paper_size#/media/File:Prevalent_default_paper_size.svg.

These seem to be the relevant changes:

--- a/widget/src/xpwidgets/nsPrintSettingsImpl.cpp      Thu Mar 22 10:30:00 2007 -0700
+++ b/widget/src/xpwidgets/nsPrintSettingsImpl.cpp      Tue Dec 27 21:40:17 2022 +0100
@@ -66,9 +66,9 @@
   mPrintPageDelay(500),
   mPaperData(0),
   mPaperSizeType(kPaperSizeDefined),
-  mPaperWidth(8.5),
-  mPaperHeight(11.0),
-  mPaperSizeUnit(kPaperSizeInches),
+  mPaperWidth(210),
+  mPaperHeight(297),
+  mPaperSizeUnit(kPaperSizeMillimeters),
   mPrintReversed(PR_FALSE),
   mPrintInColor(PR_TRUE),
   mOrientation(kPortraitOrientation),```

...or rather:

--- a/widget/nsPrintSettingsImpl.h      Tue Dec 27 05:07:30 2022 +0000
+++ b/widget/nsPrintSettingsImpl.h      Wed Dec 28 00:02:32 2022 +0100
@@ -110,9 +110,9 @@
   nsString mFooterStrs[NUM_HEAD_FOOT];
 
   nsString mPaperId;
-  double mPaperWidth = 8.5;
-  double mPaperHeight = 11.0;
-  int16_t mPaperSizeUnit = kPaperSizeInches;
+  double mPaperWidth = 210;
+  double mPaperHeight = 297;
+  int16_t mPaperSizeUnit = kPaperSizeMillimeters;
 
   bool mPrintReversed = false;
   bool mPrintInColor = true;```

I seem to have used a very ancient revision of mozilla-central.
Severity: -- → N/A
Assignee: nobody → tqpcharlie
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Probably makes more sense to do this browser-wide, since nsPrintSettingsImpl.h is browser-wide, and AFAIK GV does not set overrides for default paper size.

Component: General → Widget
Product: GeckoView → Core
Version: Firefox 108 → Trunk

(In reply to Charlotte Wilson [:cswilson252] from comment #3)

Probably makes more sense to do this browser-wide, since nsPrintSettingsImpl.h is browser-wide, and AFAIK GV does not set overrides for default paper size.

I'm not sure what GV is refering to, but from a quick look, all platforms other than Android seem to be handling this properly. It seems sensible to apply a narrow fix to Android rather than touching all platforms, but I could be convinced otherwise with the appropriate patch and testing.

Component: Widget → General
Product: Core → Firefox for Android

(In reply to Stephen A Pohl [:spohl] from comment #4)

(In reply to Charlotte Wilson [:cswilson252] from comment #3)

Probably makes more sense to do this browser-wide, since nsPrintSettingsImpl.h is browser-wide, and AFAIK GV does not set overrides for default paper size.

I'm not sure what GV is refering to, but from a quick look, all platforms other than Android seem to be handling this properly. It seems sensible to apply a narrow fix to Android rather than touching all platforms, but I could be convinced otherwise with the appropriate patch and testing.

Sorry, "GV" was referring to GeckoView :).

I'll see what I can do in terms of updating this on Android.

You need to log in before you can comment on or make changes to this bug.