[Bug 640408] New: a2ps assumes letter size paper in germany
https://bugzilla.novell.com/show_bug.cgi?id=640408 https://bugzilla.novell.com/show_bug.cgi?id=640408#c0 Summary: a2ps assumes letter size paper in germany Classification: openSUSE Product: openSUSE 11.3 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Printing AssignedTo: jsmeix@novell.com ReportedBy: jw@novell.com QAContact: jsmeix@novell.com Found By: --- Blocker: --- I use a2ps to print ascii text on my HP Photosmart C5280. The frame is too wide and too short to fit nicely on A4 Paper. right edge is 1mm from the paper edge, bottom edge is 32mm from the paper edge. I figure this would fit nicley on Letter format. With 11.2 it was possible to use kprinter once with A4 format, from then on, a2ps would also know that we live in A4 world. kprinter no longer exists on 11.3 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=640408 https://bugzilla.novell.com/show_bug.cgi?id=640408#c1 --- Comment #1 from Juergen Weigert <jw@novell.com> 2010-09-19 17:46:25 UTC --- The man-page of lpoption refers to ~/.cups lpoptions, which only specifies my default printer, and refers to /etc/cups/lpoptions, which does not exist. It also tells me that there is a -o option=value parameter, but I fail to find a list of available option names, so that I could search for something that would influence the default paper size. google suggests lpoptions -o media=a4 but now I have a frame that is so wide that it no longer fits on the page, height unchanged. The default was also far off, but closer to a4. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=640408 https://bugzilla.novell.com/show_bug.cgi?id=640408#c2 Johannes Meixner <jsmeix@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Platform|Other |All Found By|--- |Development Resolution| |WORKSFORME AssignedTo|jsmeix@novell.com |werner@novell.com OS/Version|Other |openSUSE 11.3 --- Comment #2 from Johannes Meixner <jsmeix@novell.com> 2010-09-21 07:45:11 UTC --- Do not mix up the printing application (a2ps) with the printing system (CUPS and its filters). When the printing application produces PostScript the printing system prints it by default "as is", in particular the size specified in the PostScript file. See the "Scaling to Fit" section in http://www.cups.org/documentation.php/doc-1.4/options.html or follow the "SEE ALSO" section in "man lpoptions" which points to "man lp" and then the "COMMON JOB OPTIONS" section there. Regarding a2ps, according to "man a2ps" you can specify "--medium=NAME" to use the output medium NAME which are defined in /etc/a2ps.cfg. In /etc/a2ps-site.cfg there is ----------------------------------------------------------------- # Default medium Options: --medium=LC_PAPER ----------------------------------------------------------------- so that the default medium in a2ps depends on your locale which works for me as expected: ----------------------------------------------------------------- # export LC_ALL=de_DE # export LANG=de_DE # echo de_DE | a2ps -1 -o /tmp/a2ps.de_DE.ps [stdin (unformatiert): 1 Seite auf einem Blatt] [Insgesamt: 1 Seite auf einem Blatt] in die Datei `/tmp/a2ps.de_DE.ps' geschrieben # export LC_ALL=en_US # export LANG=en_US # echo en_US | a2ps -1 -o /tmp/a2ps.en_US.ps [stdin (plain): 1 page on 1 sheet] [Total: 1 page on 1 sheet] saved into the file `/tmp/a2ps.en_US.ps' burns:~ # grep '^%%BoundingBox' /tmp/a2ps.*.ps /tmp/a2ps.de_DE.ps:%%BoundingBox: 24 24 571 818 /tmp/a2ps.en_US.ps:%%BoundingBox: 24 24 588 768 ----------------------------------------------------------------- -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=640408 https://bugzilla.novell.com/show_bug.cgi?id=640408#c3 --- Comment #3 from Dr. Werner Fink <werner@novell.com> 2010-09-21 10:01:06 UTC --- Beside this there is a patch includes in a2ps which enables the usage of the tags LC_PAPER and LC_CTYPE in /etc/a2ps-site.cfg that is # Default encoding Options: --encoding=LC_CTYPE # Default medium Options: --medium=LC_PAPER with the appropiate changes in the C source. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=640408 https://bugzilla.novell.com/show_bug.cgi?id=640408#c4 --- Comment #4 from Juergen Weigert <jw@novell.com> 2010-09-21 10:36:10 UTC --- I had expected that a2ps would get the paper size from the printer that cups sends to. Sorry. I'll use the location on Earth as a workaround: egrep -q '^TIMEZONE=\W*Europe' /etc/sysconfig/clock && echo 'export LC_PAPER=A4' >> /etc/bash.bashrc Nevertheless, I believe the new cups fitplot option would be an excellent default setting, as it could easily compensate for problems like this. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=640408 https://bugzilla.novell.com/show_bug.cgi?id=640408#c5 --- Comment #5 from Dr. Werner Fink <werner@novell.com> 2010-09-21 11:07:31 UTC --- Use /etc/bash.bashrc.local ... beside this LC_PAPER is already set by using LANG=de_DE.UTF-8 that is that locale(1) reports LC_PAPER=de_DE.UTF-8 and my patch uses case 'M': /* select a medium */ +#ifdef LC_PAPER + if (!strcasecmp("LC_PAPER", optarg)) + { + unsigned int paperheight = (unsigned int)nl_langinfo(_NL_PAPER_HEIGHT); + if (paperheight && paperheight == 279) + optarg = xstrdup("letter"); + else + optarg = xstrdup("a4"); + } +#endif xstrcpy (job->medium_request, optarg); break; to detect this. In other words LC_PAPER=A4 is nonsense. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=640408 https://bugzilla.novell.com/show_bug.cgi?id=640408#c6 --- Comment #6 from Juergen Weigert <jw@novell.com> 2010-09-21 17:23:22 UTC --- At install time, I chose, english language, german keyboard, and timezone Berlin. This gave me LC_PAPER="en_US.UTF-8" This is a) wrong and b) fragile, as setting LANG= also influences LC_PAPER unless LC_PAPER it is set explicitly. Using the timezone to make an educated guess does not appear nonsensical to me. The value A4 was trial and error - it appears to work, but may be nonsense. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=640408 https://bugzilla.novell.com/show_bug.cgi?id=640408#c7 Johannes Meixner <jsmeix@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|WORKSFORME |INVALID Summary|a2ps assumes letter size |a2ps uses Letter paper in |paper in germany |Germany if English language | |was chosen during | |installation --- Comment #7 from Johannes Meixner <jsmeix@novell.com> 2010-09-22 08:52:58 UTC --- You chose "english language" but which excat "english language" did you actaully chose: US English or British English? Perhaps /var/log/YaST2/* might help if you don't remember.
From my non-expert point of view the root cause of the issue described in comment #6 might be neither in a2ps nor in any other piece of software which belongs to the Bugzilla component "Printing" ;-)
But the issue described in comment #6 seems to be the root cause of unexpected locale-dependant settings in whatever applications (e.g. an unexpected paper size setting) so that you might file a new separated bug report regarding this issue. On the other hand unexpected locale settings in case of inconsistent language, keyboard, and timezone selections are known "since ever" so that it might be impossible to determine THE right locale (i.e. the locale which matches to the user's expectations) in case of inconsistent language, keyboard, and timezone selections. How should an automatism know if you are an US English user located in Berlin or a German user located in New York, which paper size you like to use to format your documents in your applications? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=640408 https://bugzilla.novell.com/show_bug.cgi?id=640408#c8 --- Comment #8 from Dr. Werner Fink <werner@novell.com> 2010-09-22 10:57:39 UTC --- There is also the possiblity to set RC_LC_PAPER in /etc/sysconfig/language beside this if we choose the timezone than every american user located in e.g. germany will shout. There is no perfect solution which fits all users with all thier needs. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=640408 https://bugzilla.novell.com/show_bug.cgi?id=640408#c9 --- Comment #9 from Juergen Weigert <jw@novell.com> 2010-09-22 13:03:44 UTC --- It is less about Americans or Germans, more about what paper people load in their printers. There we also find the perfect solution: Printer passes papersize to application :-) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=640408 https://bugzilla.novell.com/show_bug.cgi?id=640408#c10 --- Comment #10 from Dr. Werner Fink <werner@novell.com> 2010-09-22 13:17:46 UTC --- a2ps is not allowed to talk to printers -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=640408 https://bugzilla.novell.com/show_bug.cgi?id=640408#c11 --- Comment #11 from Johannes Meixner <jsmeix@novell.com> 2010-09-22 14:17:32 UTC --- Not the printers (i.e. the hardware) passes papersize info to applications but any application can query CUPS (i.e. any cupsd which is accessible on localhost or via network) to get the PPD file content for a specific print queue (and use the user's default print queue as fallback). The PPD file contains in particular a list of "PageSize" values and one which is the "DefaultPageSize". But I wonder if a2ps upstream would like to add CUPS support? Furthermore: Applications never ever care about printing-related stuff early enough - i.e. while the user is creating a document which is meant to be printed later. If at all applications only query the printing system regarding printing-related stuff after the user had finished the document when he wants to get it "just printed right now". Then it is of course usually too late to layout the document (and the user's focus of mind is no longer at "layout") so that the content could fit well into the printable area of the particular printer or that the nice looking colors could be distinguishable even on a b/w printer and so on... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=640408 https://bugzilla.novell.com/show_bug.cgi?id=640408#c12 --- Comment #12 from Johannes Meixner <jsmeix@novell.com> 2010-09-23 10:11:55 UTC --- FYI: It doesn't solve the issue but at least explains the mess: http://en.opensuse.org/SDB:Print_Settings_with_CUPS "Different default paper size settings" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com