Bug 82929

Summary: printing with CUPS gives ps files with height set to 0
Product: [Applications] kdeprint Reporter: Nicolas SOUCHON <nsouchon-perso>
Component: generalAssignee: KDEPrint Devel Mailinglist <kde-print-devel>
Status: CLOSED WORKSFORME    
Severity: normal CC: jlayt
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Nicolas SOUCHON 2004-06-06 10:18:28 UTC
Version:           kprinter 0.0.1 (using KDE KDE 3.2.1)
Installed from:    Compiled From Sources
Compiler:          gcc 2.96 
OS:                Linux

environnement :
 Mandrake Linux: 2.4.18-6mdk
 Qt: 3.3.0
 KDE: 3.2.0
 kprinter: 0.0.1
 cups: 1.1.14

a little application to test printer:

void tst_kdeprint::slotPrint()
{
   KPrinter printer;
   if( printer.setup( this ) )
   {
      printer.setDocName( "tst_kdeprint" );
      QPainter p;
      p.begin( &printer );
      p.drawText( 100, 100, 1000, 1000, Qt::AlignTop | Qt::AlignLeft, "Essai ..." );
      p.end();
      if( printer.outputToFile() )
      {
         char c[1024];
         sprintf( c, "cupsdoprint -P 'Imprimante' -J 'tst_kdeprint' -H 'localhost:631' "
            "-o ' PageSize=A4 copies=1 media=A4 multiple-document-handling=separate-documents-collated-copies orientation-requested=3' '%s'", printer.outputFileName().ascii() );
         printf( "commande: %s\n", c );
         fflush( stdout );
         system( c );
      }
   }
}

printing to ps file works fine, the command cupsdoprint ... is correctly executed ...
printing with CUPS doesn't work

added some trace to cupsdoprint ... here is what i obtained:
--------------------------------------------------------------
P: Imprimante
J: tst_kdeprint
H: localhost:631
o:  copies=1 multiple-document-handling=separate-documents-collated-copies orientation-requested=3
Processed options (n=3):
   copies = 1
   multiple-document-handling = separate-documents-collated-copies
   orientation-requested = 3
Files (1):
   /tmp/kde-ns/kdeprint_CvqOtQN1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ls al /tmp/kde-ns/kdeprint_CvqOtQN1 /home/ns/print.ps
-rw-rw-r--    1 ns       ns           9695 jun  6 09:47 /home/ns/print.ps
-rw-rw-r--    1 ns       ns           9684 jun  6 09:47 /tmp/kde-ns/kdeprint_CvqOtQN1
diff /tmp/kde-ns/kdeprint_CvqOtQN1 /home/ns/print.ps
2c2
< %%BoundingBox: 0 0 594 0                                             <-- ????????????
---
> %%BoundingBox: 0 0 594 842
5c5
< %%CreationDate: Sun Jun 6 09:47:57 2004
---
> %%CreationDate: Sun Jun 6 09:47:52 2004
99,101c99,101
< 0 0 translate
< % 210*0mm (portrait)                                                 <-- ????????????
< 0 0 translate 0.75 -0.75 scale/defM matrix CM d } d
---
> 36 24 translate
> % 184*280mm (portrait)
> 0 794.25 translate 0.75 -0.75 scale/defM matrix CM d } d
Comment 1 Michael Goffioul 2004-06-07 20:02:25 UTC
Can you check the margins and page size in the "Margins" tab of the printer properties dialog? There was some bugs when parsing PPD files, which were fixed in 3.2.1 and 3.2.2.
Comment 2 Cristian Tibirna 2005-09-24 06:26:41 UTC
Waiting for the answer and for check with current kdeprint.
Comment 3 Kurt Pfeifle 2007-01-08 23:45:08 UTC
Closing this (unconfirmed) bug due to timeout for feedback requested by Cristian [2005-09-24 06:26] and Michael [2004-06-07 20:02]. 
 
Nicolas, feel free to re-open this report if the issue still bugs you with KDE 3.5.5.
Comment 4 John Layt 2008-12-31 17:25:10 UTC
Closing old Resolved status bug.