Bug 216332

Summary: Presentation duplex printing doesn't even out duplexed pages
Product: [Fedora] Fedora Reporter: Tim Waugh <twaugh>
Component: openoffice.orgAssignee: Caolan McNamara <caolanm>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: jnavrati
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.2.1-17.2.fc8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-31 17:52:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
replacement /usr/lib/openoffice.org/program/libsvt680li.so
none
replacement verbose /usr/lib/openoffice.org/program/libpsp680li.so
none
replacement /usr/lib64/openoffice.org/program/libsvt680li.so
none
replacement verbose /usr/lib64/openoffice.org/program/libpsp680li.so
none
park this here in case I delete it or do something else equally stupid none

Description Tim Waugh 2006-11-19 11:57:48 UTC
Description of problem:
When printing more than one copy of a presentation containing an odd number of
pages to a duplex printer with duplexing on, the last and first pages run
together on one sheet.

Version-Release number of selected component (if applicable):
openoffice.org-core-2.0.4-5.5.3

How reproducible:
100%

Steps to Reproduce:
1.New presentation from template 'Introducing a new product'
2.File->Print, select duplex-capable printer
3.Set 'Print Pages' page range to '1' (just saves paper)
4.Set Copies to 2, and Collate on
5.In 'Page Setup' set the Two-sided option to 'Short Edge (Flip)'
6.Click Print

Actual results:
Single sheet with same slide on both sides.

Expected results:
Two sheets, each with slide on one side and blank reverse side.

Additional info:
This doesn't happen with OpenOffice.org Writer, so it's probably something
specific to the Spreadsheet app.  It might be something like that OOo is
manually generating multiple copies and then setting Duplex on -- when what it
should do it just tell CUPS how many copies to print in the job options, and set
Duplex in the job options as well.  That way CUPS can work out what needs to be
done to even out duplexed copies.

Comment 1 Tim Waugh 2006-11-19 11:59:04 UTC
*** Bug 216140 has been marked as a duplicate of this bug. ***

Comment 2 Caolan McNamara 2007-02-01 15:31:00 UTC
This is still a problem, i.e. it didn't get magically fixed with the last OOo
FC-6 update ?

Comment 3 Tim Waugh 2007-02-05 15:23:01 UTC
Still a problem.
openoffice.org-core-2.0.4-5.5.10

Comment 4 Caolan McNamara 2007-05-01 14:25:39 UTC
hmm, indeed. looks like we just don't use cups for any of this stuff. Perhaps
the best thing would be to just chop out all the OOo multi platform DIY magic
and make it make simple single copies and let cups do all this foo for it.

Comment 5 Caolan McNamara 2007-05-01 16:15:11 UTC
Created attachment 153865 [details]
replacement /usr/lib/openoffice.org/program/libsvt680li.so

So (on FC-7) does replacing /usr/lib/openoffice.org/program/libsvt680li.so with
this attachment "do the right thing(tm)" ?

Comment 6 Tim Waugh 2007-05-02 10:02:26 UTC
No, it doesn't.

Printing two copies of a single-page document results in four sheets coming from
the printer, the first and third of which contain the document.

Printing one copy of a 2-page document results in two complete double-sided
sheets containing the document, i.e. two copies instead of one!

Comment 7 Caolan McNamara 2007-05-02 10:59:39 UTC
That's depressing, I thought that would work :=) I must be missing something
obvious. I don't get the extra pages on my non-duplex. With the above OOo itself
should just be giving cups a simple single copy of the .ps with no /ncopies or
self made extra copies. i.e setting 2 copies and collate on or off and print to
file should show in evince a single page, and grep pages output.ps should show
nothing. So if the above holds for you as well, I must assume I'm passing cups
incorrect options, or doing something very obviously wrong.

I'll attach another replacement .so which will replace
/usr/lib/openoffice.org2.0/program/libpsp680.so

That lib will on stdout output the cups options used to print the .ps, and copy
the generated .ps to ~/cupsprint.ps, maybe if you've the time to check it out,
something obvious will jump out at you.

Comment 8 Caolan McNamara 2007-05-02 11:00:45 UTC
Created attachment 153930 [details]
replacement verbose /usr/lib/openoffice.org/program/libpsp680li.so

Comment 9 Tim Waugh 2007-05-02 16:56:39 UTC
Okay, the extra pages were partly due to an incorrect page size in my test
document.  However, even with that corrected I still get an extra sheet fed
after a 1-copy 1-page print.  Haven't managed to track down why yet.

1-copy 2-page print correctly feeds one sheet and prints on both sides.

2-copy 3-page print incorrectly prints on first side of first sheet and ejects,
first side of second sheet (upside down), then feeds another two sheets blank. 
It's a complete disaster in all sorts of ways.

However, I'm not sure I can trust the hardware any more.  Rebooting to
known-good software (RHEL-5) shows the same behaviour. :-(


Comment 10 Caolan McNamara 2007-05-03 08:09:57 UTC
Created attachment 154009 [details]
replacement /usr/lib64/openoffice.org/program/libsvt680li.so

64bit equivalents

Comment 11 Caolan McNamara 2007-05-03 08:11:29 UTC
Created attachment 154010 [details]
replacement verbose /usr/lib64/openoffice.org/program/libpsp680li.so

64bit version

Comment 12 Caolan McNamara 2007-05-03 08:22:38 UTC
caolanm->jnavrati: I only have one printer here, and it doesn't do duplex :-( I
don't get any of the extra empty pages etc on such a simple printer. Can you
give this a whirl with a duplex printer in your office and see if you get the
same behaviour as twaugh when the various duplex options with or without collate
is enabled.

All that the above .sos should do is tell the OOo core from the print dialog
that we want just want a simple single copy .ps output to the printer no matter
how many we ask to print, and then at the actual cups print time we tell cups
that we had wanted to do Duplex and how many copies we had wanted. Cutting the
OOo core out of the loop and pushing the work to cups. What options we want cups
to use should be output on standard output.

twaugh: The replacements sos also make a copy of the printed .ps to
"~/cupsprint.ps", perhaps if you just take that .ps output and from the command
line print it with lpr and set the num copies and duplex etc we can see if the
behaviour is the same as from using print in OOo. I suppose if it behaves the
same, that the remaining comparison would be against what happens on printing
from the command line ps generated from e.g. gedit

Comment 13 Tim Waugh 2007-05-04 15:37:58 UTC
caolan: I hope to get replacement hardware in the next week or two.  Without
reliable hardware there's not a lot I can do to help test it.  I did try to
submit the PostScript outside of OpenOffice.org, and with different options, but
as I said a known-working software set up also failed.

Comment 14 Caolan McNamara 2007-05-04 15:49:27 UTC
There's no major hurry, it's been like this for years already so I don't intend
to make any printing changes just before FC-7 anyway. When I get my next build
sorted out, then jnavrati may be able to test the above x86_64 replacements in
brnu where there's reportedly a few expensive multi-featured printers. If we
finally get this sorted out and working in rawhide then we might backport.

Comment 15 Tim Waugh 2007-05-08 16:17:46 UTC
Okay, tested with a replacement duplex printer, and all works fine.

cupsPrintFile( DESKJET_980C, /tmp/F8PEcB, Untitled1, 10, 0x976f1f0 ) returns 35
    option PrintoutMode=Normal
    option copies=2
    option InputSlot=Default
    option job-priority=50
    option Collate=True
    option number-up=1
    option Quality=FromPrintoutMode
    option job-sheets=none,none
    option PageSize=A4
    option Duplex=DuplexNoTumble

THis was for two copies of a three-page document, and I got:

front  back
+---+  +---+
|1  |  |2  |
|   |<>|   |
|   |  |   |
+---+  +---+

+---+  +---+
|3  |  |   |
|   |<>|   |
|   |  |   |
+---+  +---+

as expected.

This was with the drop-in bits, libsvt680li.so and libpsp680li.so, on Fedora 7.

For what it's worth, I also tried the same test from Fedora Core 6 and *that*
works fine now too (openoffice.org-core-2.0.4-5.5.22) -- however, the "let CUPS
figure it out" approach is the way forward anyway I think.

By the way, the cupsprint.ps file still has several '%%IncludeFeature:' clauses
-- I don't think we need them now do we?  E.g.:

[{
%%IncludeFeature: *PrintoutMode Normal
} stopped cleartomark
[{
%%IncludeFeature: *Quality FromPrintoutMode
} stopped cleartomark
[{
%%IncludeFeature: *InputSlot Default
} stopped cleartomark
[{
%%IncludeFeature: *PageSize A4
} stopped cleartomark
[{
%%IncludeFeature: *Duplex DuplexNoTumble
} stopped cleartomark

Removing those lines from the PostScript file and submitting it again with the
options it had before gives the same end result.

Comment 16 Caolan McNamara 2007-05-08 18:19:38 UTC
groovy, I'll do this for > FC-7 then. Printing is too much of a mine field to
enter right before a release.

Yeah, I also need to remove those IncludeFeature things. What I want to do is
just to remove them if we print from the gnomeprint dialog, but leave them there
if printing from the "traditional" dialog. Gives is an escape hatch route of a
"does it work if you try the other dialog" nature.

Comment 17 Tim Waugh 2007-05-09 08:48:42 UTC
Sounds good!

Comment 18 Caolan McNamara 2007-05-09 10:52:37 UTC
Created attachment 154386 [details]
park this here in case I delete it or do something else equally stupid

Comment 19 Caolan McNamara 2007-05-21 13:51:38 UTC
checked in to devel, will be in F-8

Comment 20 Fedora Update System 2007-07-30 16:58:47 UTC
openoffice.org-2.2.1-18.1.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.