The above code will do the right thing by default on all POSIX platforms (not just Linux) and provides easy and obvious ways for users to override the defaults. It won't work on other platforms and just leads to ugly platform-specific #ifdef massacres.
The nl_langinfo(PAPER_HEIGHT) / nl_langinfo(PAPER_WIDTH) was a draft proposal (ISO technical report 14652) that only glibc implemented but that never made it into the POSIX standard or any other ISO standard. The alternatives simply don't wash: The /etc/papersize mechanism is a complete non-starter, as it is a global setting that you cannot easily override for individual users or processes. My original proposal above, from, namely to decide on preferred units of measurement and standard paper size by searching for country codes in the LC_* environment variables (exactly as suggested in the above piece of code) is IMHO still the most advisable solution today! Please just try it, before thinking up alternatives. That differs so dramatically from international standards. The default distribution shouldn't force users to use a locale setting (en_US)
"en" differs from "en-US" in that itĪpplies ISO standards for default settings instead of US customary values.Įn-US: US Letter, inches, mm/dd/yy, am/pm To the default download version of Mozilla. So they will still get their special national 8.5x11" paper format configuredĬorrectly, without disrupting Mozilla printing worldwide, as it happens at theĪnother idea is to include in addition to "en-US" also a language setting "en" Set (often also with LC_COLLATE=POSIX to prevent ls changing its sorting order),
Printf("Paper: %s\nUnits: %s\n", paper, units) Īmerican users should (and with most distributions typically have) LANG=en_US * LC_PAPER and LC_MEASUREMENT were introduced Under Linux as in the following example code: Theĭefault settings for printer paper and unit of measurement should be determined North America by looking at the standard POSIX locale environment variables. Suggestion: Mozilla for Linux can trivially determine whether it was invoked in No changing to A4 should be necessary ever. It is currently not at all obvious for a highly computer literate userĪ non-North American user should never ever have to worry about the paper size. Millimeters, not inches, but the default margin settings in the print menu use Similarly, the vast majority of users worldwide are used to think in Printers (namely practically *every* printer outside the USA and Canada) is fed This is extremely disruptive for most users. Setting en-US only and sets the printing page size at each invocation back to This can also vary by operating system.The default download binary of Mozilla 1.0rc2 for Linux comes with language
Note that not all brands of printer drivers will give you access to the spooler settings through that specific Properties button.
When you press you will see what is called the "native print dialog box", click the "Properties" button in the upper right of that window, with the correct printer showing in the Printer - Name: box. Changing the spooler setting anywhere else except from the "native print dialog" when accessed through Firefox, may not set that preference to affect Firefox. If you are not having problems printing with other applications and if, on Windows, the print spooler service (spoolsv.exe) is already running and is set to automatic you'll need to turn on the Print Spooler in your printer's preferences dialog box, through Firefox and the "native print dialog". The print spooler service is not running. If you click Yes, you may see the message, Operation could not be completed.
If you attempt to print a web page, a dialog box may appear with the message, Before you can perform printer-related tasks such as a page setup or printing a document, you need to install a printer.