Bug#388569: general: always printed in letter format

2006-09-23 Thread gerhard oettl
On Fri, Sep 22, 2006 at 01:00:28PM +0200, gregor herrmann wrote:
>On Thu, 21 Sep 2006 11:13:27 +0200, gerhard oettl wrote:
>
>> Since updating to etch some weeks ago i was not able to print
>> from firefox, because always letter format is requested on the
>> printer panel.
>
>Do you have /etc/papersize and what is its content?



ls -l /etc/paper*
-rw-r--r-- 1 root root 595 2002-03-20 12:02 /etc/paper.config
-rw-r--r-- 1 root root   3 2004-03-26 14:53 /etc/papersize
-rw-r--r-- 1 root root   7 2004-12-10 15:35 /etc/papersize.dpkg-dist
-rw-r--r-- 1 root root   7 2006-09-09 23:01 /etc/papersize.dpkg-inst
-rw-r--r-- 1 root root   7 2006-08-16 19:19 /etc/papersize.ucf-dist



File paper.config:

[Paper]
US-Letter={612 792 72 72 72 72}
US-Legal={612 1008 72 72 72 72}
A3={841.88976 1190.5512 80 80 80 80 }
A4={595.27559 841.88976 80 80 80 80}
A5={420.94488 595.27559 80 80 80 80}
B4={730 1034 60 60 60 60}
B5={500 710 80 80 80 80}
B5-Japan={517 730 80 80 80 80}
Half-Letter={612 397 72 72 72 72}
Executive={523 758 72 72 72 72}
Tabloid/Ledger={794 1227 72 72 72 72}
Monarch={280 542 10 10 10 10}
SuperB={843 1227 80 80 80 80}
Envelope-Commercial={298 686 5 5 5 5}
Envelope-Monarch={280 542 5 5 5 5}
Envelope-DL={312 625 5 5 5 5}
Envelope-C5={460 650 5 5 5 5}
EuroPostcard={298 420 5 5 5 5}

File papersize:
A4

File papersize.dpkg-dist:
letter

File papersize.dpkg-inst:
letter

File papersize.ucf-dist:
letter


I changed /etc/papersize from A4 to a4 temporary (and restarted
to be sure) -> unchanged behaviour.

The environment variables PAPERSIZE and PAPERCONF are not set.




I am not an expert in postscript but as far as i anderstand the
papersize is inital set correct to A4.

According to 
<http://partners.adobe.com/public/developer/en/ps/PS3010and3011.Supplement.pdf#search=%22postscript%20%2Fpagesize%20%20595%20site%3Aadobe.com%22>

the correct /PageSize value for A4 is [ 595 842 ] in default user
space units.

firefox by:
%%BoundingBox: 0 0 595 842
%%HiResBoundingBox: 0 0 595.25 841.9
%%DocumentPaperSizes: A4
and later in the suspect conditional area:
  dup /PageSize [ 595.25 841.9 ] put

xpdf by:
%%DocumentMedia: plain 595 841 0 () ()
%%BoundingBox: 0 0 595 841


The minimal differences seam to be ok. Both documents can 
be printed without changing this parts. But if the line 
containing
/PageSize 3
is present something unexpected happens.
All i understand is that a condition (that i dont anderstand) 
is tested and that the conditional part that contains that
/PaperSize 3 
line is proceeded.



Could there be an error in the ppd (postscript printer
description file) the reason for this? 
On the other hand: When setting the printer to a lexmark 
the first 250 lines of the postscript file are the same.



The printing also looks fine, if i remove the whole block that
contains that /PageSize 3 line. So it looks like this block is
not necessary at all or there is an error in the tested condition
and the test should return an result that does not process that
block.

--- firefox_letter.ps   2006-09-21 10:41:32.0 +0200
+++ firefox_a4-min.ps   2006-09-22 19:44:40.0 +0200
@@ -12,12 +12,7 @@
 
 %%BeginProlog
 /setpagedevice where
-{ pop 2 dict
-  dup /PageSize [ 595.25 841.9 ] put
-  dup /Policies 1 dict
-dup /PageSize 3 put
-  put
-  setpagedevice
+{
 } if
 [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
  /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef


--- xpdf_letter.ps  2006-09-21 10:25:32.0 +0200
+++ xpdf_a4-min.ps  2006-09-22 19:46:21.0 +0200
@@ -17,12 +17,6 @@
 /pdfSetup {
   3 1 roll 2 array astore
   /setpagedevice where {
-pop 3 dict begin
-  /PageSize exch def
-  /ImagingBBox null def
-  /Policies 1 dict dup begin /PageSize 3 def end def
-  { /Duplex true def } if
-currentdict end setpagedevice
   } {
 pop pop
   } ifelse



The remaining question is: Where does this parts come from?


-- 
 .''`.   gerhard oettl   on   Debian/Gnu Linux
: :'  :  
`. `'`   gpg key: 1024D/D59131AA 2002-06-18
  `-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#388569: general: always printed in letter format

2006-09-22 Thread gerhard oettl

Maybe this posting is related to this bug?

<http://blog.gmane.org/gmane.comp.gnome.print?set_lines=10>


-- 
 .''`.   gerhard oettl   on   Debian/Gnu Linux
: :'  :  
`. `'`   gpg key: 1024D/D59131AA 2002-06-18
  `-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#388569: general: always printed in letter format

2006-09-21 Thread gerhard oettl
Package: general
Severity: important


Sorry for reporting on this unspecific level, but i cannot
isolate.

Since updating to etch some weeks ago i was not able to print
from firefox, because always letter format is requested on the
printer panel. This happens independend of the input in the
printer property fields in the printing dialog if firefox (where
i entered "A4") and independend of the printer settings in cups
(where i also use "A4") - see bug 383.255.

First i thought this a specific problem of firefox, but now i
have the same missbehaviour with xpdf, so i think it is a more
general problem which i cannot identify.

Both programms worked fine in sarge.

The only help i can give, is that i can work around in both cases
by printing to a file and remove the first line containing
"/PageSize 3" with an editor and afterwards use lpr on the
command line to print that modified postscript-file.

Because i cannot think that this is the intended "new debian way
of printing" and because a am happy with debian for years i dont
want to change distribution because of this, but i also dont want
to life with this situation for a long time. 

I use a standard gnome desktop installation and the Cups printing
system. My printer is a HP Laserjet 4 plus.


Two examples:
=

* head of the original postscript file (requesting letter format
  independend of the "%%DocumentPaperSizes: A4" line) produced by
  firefox:

%!PS-Adobe-3.0
%%BoundingBox: 0 0 595 842
%%HiResBoundingBox: 0 0 595.25 841.9
%%Creator: Mozilla PostScript module (rv:1.8.0.6/0)
%%DocumentData: Clean8Bit
%%DocumentPaperSizes: A4
%%Orientation: Portrait
%%Pages: 1
%%PageOrder: Ascend
%%EndComments
% MozillaCharsetName: iso-8859-1

%%BeginProlog
/setpagedevice where
{ pop 2 dict
  dup /PageSize [ 595.25 841.9 ] put
  dup /Policies 1 dict
dup /PageSize 3 put
  put
  setpagedevice
} if


* diff file against the modified firefox postscript file which
  worked fine on my printer:

--- firefox_letter.ps   2006-09-21 10:41:32.0 +0200
+++ firefox_a4.ps   2006-09-21 10:41:55.0 +0200
@@ -15,7 +15,6 @@
 { pop 2 dict
   dup /PageSize [ 595.25 841.9 ] put
   dup /Policies 1 dict
-dup /PageSize 3 put
   put
   setpagedevice
 } if


* original postscript file (requesting letter format) 
  produced by xpdf:

%!PS-Adobe-3.0
%%Creator: xpdf/pdftops 3.01
%%LanguageLevel: 2
%%DocumentSuppliedResources: (atend)
%%DocumentMedia: plain 595 841 0 () ()
%%BoundingBox: 0 0 595 841
%%Pages: 1
%%EndComments
%%BeginDefaults
%%PageMedia: plain
%%EndDefaults
%%BeginProlog
%%BeginResource: procset xpdf 3.01 0
/xpdf 75 dict def xpdf begin
% PDF special state
/pdfDictSize 15 def
/pdfSetup {
  3 1 roll 2 array astore
  /setpagedevice where {
pop 3 dict begin
  /PageSize exch def
  /ImagingBBox null def
  /Policies 1 dict dup begin /PageSize 3 def end def
  { /Duplex true def } if
currentdict end setpagedevice
  } {
pop pop
  } ifelse
} def
/pdfStartPage {
  pdfDictSize dict begin
  /pdfFillCS [] def
  /pdfFillXform {} def
  /pdfStrokeCS [] def
  /pdfStrokeXform {} def
  /pdfFill [0] def
  /pdfStroke [0] def
  /pdfFillOP false def
  /pdfStrokeOP false def
  /pdfLastFill false def
  /pdfLastStroke false def
  /pdfTextMat [1 0 0 1 0 0] def
  /pdfFontSize 0 def
  /pdfCharSpacing 0 def
  /pdfTextRender 0 def
  /pdfTextRise 0 def
  /pdfWordSpacing 0 def
  /pdfHorizScaling 1 def
  /pdfTextClipPath [] def
} def
/pdfEndPage { end } def


* diff file against the modified xpdf postscript file which
  worked fine on my printer:

--- xpdf_letter.ps  2006-09-21 10:25:32.0 +0200
+++ xpdf_a4.ps  2006-09-21 10:38:57.0 +0200
@@ -20,7 +20,6 @@
 pop 3 dict begin
   /PageSize exch def
   /ImagingBBox null def
-  /Policies 1 dict dup begin /PageSize 3 def end def
   { /Duplex true def } if
 currentdict end setpagedevice
   } {




By the way printing from openoffice works fine (at least writer
and calc).


Feel free to request any information you need to isolate that
missbehaviour.



-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-2-686
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]