|
Bugzilla – Full Text Bug Listing |
| Summary: | mozilla/firefox/thunderbird default paper size should be adjusted | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE Linux 10.1 | Reporter: | Bjoern Jacke <bjacke> |
| Component: | Firefox | Assignee: | E-mail List <bnc-team-mozilla> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Enhancement | ||
| Priority: | P5 - None | CC: | Ivory, jsmeix, suse-beta |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Bug Depends on: | |||
| Bug Blocks: | 148707 | ||
|
Description
Bjoern Jacke
2005-02-03 21:36:36 UTC
and the same for Thunderbird in /opt/MozillaThunderbird/lib/defaults/pref and in Mozilla in /opt/MozillaThunderbird/lib/defaults/pref please. the second was supposed to be /opt/mozilla/lib/defaults/pref of course. I don't like SuSEconfig for this. Johannes, is there any way to get the supported papersize with CUPS? cups lib could provide you with the paper size of each printer but cups libs aren't used. it would maybe be possible to set up a filter which does a papersize fitting but that can never solve the problem that the page layout will still be wrong. As long as the mozilla apps don't have full cups lib support I don't see a different way than SuSEconfig. Yes. The correct way is that CUPS support must be added to the browser. I.e. the browser must be enhanced to use the CUPS libraries. Then the browser can ask the CUPS system for the available queues and it can display the queues to the user and for each queue it can get the whole PPD file or the available options and possible choices for each option in the PPD file and it can display this to the user too. The user selects the queue and the option choices and then the browser printing engine can produce a PostScript output which matches perfectly to the selected queue and options. (This is what OOo does at the moment and therefore the OOo printing output depends on the selected queue). But if you are looking for a script based hack to determine the default paper size and then hack it into a browser config file then you can "wget" the PPD file for a known queue from a known host where a CUPS server runs, see http://portal.suse.com/sdb/en/2004/05/jsmeix_print-cups-in-a-nutshell.html "cupsd Web Front-end". I think such a script becomes terrible complicated if it should work in any case, e.g. for remote queues or if there is a CUPS "client-only" setup (no local running cupsd). But only for the default queue and only for "localhost" it is easy: wget --quiet -O - \ http://localhost:631/printers/$( lpstat -d | sed -e 's/[^:]*: //' ).ppd \ | grep '^*DefaultPageSize:' | sed -e 's/[^:]*: //' If you need to do it when the browser package is installed (then there is no local cupsd running) then all you can do is to ask the YaST experts where the timezone/country information is stored and if it is US then set Letter in the browser's config file and otherwise use A4. In particular if any attempt to autodetect the paper-size fails, use A4 as fallback because this makes the majority of users happy. Mozilla does definitely use the cups libs in the meantime. This could/should be enhanced. The queues are already taken from the CUPS server. It shouldn't be too hard to get at least the DefaultPageSize. (but not for 9.3 timeframe) If it is not in 9.3 timeframe, I would like to emphasize part of
Johannes' comment:
> In particular if any attempt to autodetect the paper-size fails,
> use A4 as fallback because this makes the majority of users happy.
Please make the defaults of the RPM to A4.
bjacke@pell:~> rpm -qR MozillaFirefox|grep cups bjacke@pell:~> mozilla the same, so there is no cups support (or it's statically linked in), it probably uses lpstat, /etc/printcap etc. A dirrerent way, which would in deed be much better than /etc/papersize is to use the default paper size of the locale. the locale's paper size can also be found out at runtime. It's still not as good as finding out from the cups server but this way would also the the best effort for non-cups setups Björn, you can trust me that the printer list is fetched from CUPS ;-) Mozilla does load many libs via dlopen to avoid hard dependencies. The same for CUPS support. I will check what could be done until 9.3 > > In particular if any attempt to autodetect the paper-size fails,
> > use A4 as fallback because this makes the majority of users happy.
> Please make the defaults of the RPM to A4.
It should default to the paper-size according to LC_PAPER.
In shell syntax:
# LC_PAPER=en_US.UTF-8 locale -k height | grep height=297 &>/dev/null && \
echo a4 || echo letter
letter
# LC_PAPER=en_GB.UTF-8 locale -k height | grep height=297 &>/dev/null && \
echo a4 || echo letter
a4
Needs to be implemented by using nl_langinfo.
First of all it should not default to the paper-size according to LC_PAPER but to the paper size of the actual CUPS queue because otherwise it would not print correctly (assume you are in the US but have a de_DE locale setting). But if it fails to determine the paper size of the actual CUPS queue then it could default to the paper-size according to LC_PAPER. I agree. Only if the detection via CUPS fails, it should default to the paper-size according to LC_PAPER. in shell syntax for cups: lpoptions -l -d printqueuename |grep PageSize |sed "s/.*\*\([^ ]*\).*/\1/" but should also be implemented using cups lib ;-) Wrong! Please test before posting commands. See "man lpoptions" what "-d" does and care about ordering of parameters. Additionally there should be a test and a fallback if the queue's page size is not supported by Mozilla: lpoptions -p $QUEUE -l 2>/dev/null \ | sed -n -e 's/^PageSize.*\*\([^ ]*\).*/\1/p' \ | egrep 'Letter|A4' || echo 'A4' where "echo 'A4'" should be replaced by a fallback according to LC_PAPER. Strange: jsmeix@nelson:~> echo $LC_ALL en_GB.iso885915 jsmeix@nelson:~> locale LANG=en_GB.iso885915 LC_CTYPE="en_GB.iso885915" LC_NUMERIC="en_GB.iso885915" LC_TIME="en_GB.iso885915" LC_COLLATE="en_GB.iso885915" LC_MONETARY="en_GB.iso885915" LC_MESSAGES="en_GB.iso885915" LC_PAPER="en_GB.iso885915" LC_NAME="en_GB.iso885915" LC_ADDRESS="en_GB.iso885915" LC_TELEPHONE="en_GB.iso885915" LC_MEASUREMENT="en_GB.iso885915" LC_IDENTIFICATION="en_GB.iso885915" LC_ALL=en_GB.iso885915 jsmeix@nelson:~> echo $LC_PAPER jsmeix@nelson:~> Why does "echo $LC_PAPER" result nothing but "locale" shows it? Is this correct behaviour or is my setup broken? LC_PAPER derives the value of LC_ALL. The values you can see in the locale output with "" are derived values, the others like LANG/LC_ALL in your example are explicitely set. Just for completeness. The plan is to get the default paper size from CUPS. But I don't know when this can be implemented upstream. I know something about mozilla code but nothing about cups code. there is some work ongoing in https://bugzilla.mozilla.org/show_bug.cgi?id=324060 It's rather late for 10.1 and we'll have to wait until the patch there is finally reviewed for inclusion. So only if we are very lucky this could make it into 10.1 If I understand the initial comment in bug #148707 correctly then Mozilla uses Letter as default/fallback. But see the 4. and 5. comment in bug #148707: Why isn't it possible as a quick hack now for 10.1 to simply replace "Letter" with "A4" in the source or in defaults/pref to have a good default for most (i.e. all except US) of the users? OK, I know it's most likely too late to get it in for 10.1 but we will evaluate it for SLE10. (At least for Firefox) I have an internal test package ready which seems to work correctly for me. We have to do some further tests before we can try to push it in so late in the cycle. fix submitted for Firefox 10.1rc3. SeaMonkey and Thunderbird don't use it yet. fixed almost everywhere |