https://bugs.winehq.org/show_bug.cgi?id=55718
Bug ID: 55718 Summary: Word 2007 is not able to print multiple copies of a page Product: Wine Version: 8.17 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: dmitry@baikal.ru CC: piotr.caban@gmail.com Distribution: ---
Steps to reproduce: 1. wine WINWORD.EXE 2. Ctrl+P (File -> Print), it's fine to print empty document 3. Select "Print to file", set "Number of copies" to 2, select "Current page" for clarity 4. Press OK, save "output.prn".
When the bug is not present output.prn should contain the comment %cupsJobTicket: copies=2
According to my limited testing the problem is caused by EMRI_DEVMODE record (which contains correct dmCopies) being written at the end of the spool file, and as a result DEVMODE is processed too late.
https://bugs.winehq.org/show_bug.cgi?id=55718
--- Comment #1 from Piotr Caban piotr.caban@gmail.com --- It should be fixed by: https://gitlab.winehq.org/wine/wine/-/merge_requests/4026 Could you please give it a try?
https://bugs.winehq.org/show_bug.cgi?id=55718
--- Comment #2 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to Piotr Caban from comment #1)
It should be fixed by: https://gitlab.winehq.org/wine/wine/-/merge_requests/4026 Could you please give it a try?
Thanks for working on this. Unfortunately these patches don't help.
https://bugs.winehq.org/show_bug.cgi?id=55718
Vitaly Lipatov lav@etersoft.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |lav@etersoft.ru
https://bugs.winehq.org/show_bug.cgi?id=55718
--- Comment #3 from Piotr Caban piotr.caban@gmail.com --- Here's what the application does: StartDoc ResetDC -> that changes number of copies StartPage
I've tried adding GetJob call to check what's stored in jobs devmode. It turns out that dmCopies==1 in this cause even so 2 copies are printed. It means that different way of passing information about number of copies to print processor / printer driver is used. This generally confirms that MR4026 is correct even so it doesn't fix Word printing.
I don't know yet how it's supposed to work. I'm still doing some more testing.
https://bugs.winehq.org/show_bug.cgi?id=55718
--- Comment #4 from Piotr Caban piotr.caban@gmail.com --- It turns out that winprint print processor updates number of copies to print based on first page DEVMODE. I have written a custom print processor that doesn't do it and it breaks printing in Word 2007 so number of copies is ignored.
Please note that this is a workaround for application bug. It will not work on Windows in some printer configurations (e.g. in v3 drivers when direct printing is used or when custom print processor is used).
I know how to fix it now.
https://bugs.winehq.org/show_bug.cgi?id=55718
--- Comment #5 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to Piotr Caban from comment #4)
It turns out that winprint print processor updates number of copies to print based on first page DEVMODE. I have written a custom print processor that doesn't do it and it breaks printing in Word 2007 so number of copies is ignored.
Please note that this is a workaround for application bug. It will not work on Windows in some printer configurations (e.g. in v3 drivers when direct printing is used or when custom print processor is used).
I know how to fix it now.
Thanks Piotr. This confirms the result of my testing which shows that printing correct number of copies worked in wine-4.0, and was broken between wine-4.1 and wine-4.2 by the following commit
commit c4a54852952a59c3129beac78c08cad56643fe22 Author: Dmitry Timoshkov dmitry@baikal.ru Date: Wed Feb 13 11:40:30 2019 +0000
wineps.drv: PostScript header should be written by StartDoc instead of StartPage.
This commit fixes a test case, so it's correct. However it shows that DEVMODE seen by StartPage() contains correct number of copies while StartDoc() sees DEVMODE with wrong dmCopies value. That essntially confirms your finding.
https://bugs.winehq.org/show_bug.cgi?id=55718
--- Comment #6 from Piotr Caban piotr.caban@gmail.com --- I've created MR addressing the bug: https://gitlab.winehq.org/wine/wine/-/merge_requests/4075
https://bugs.winehq.org/show_bug.cgi?id=55718
--- Comment #7 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to Piotr Caban from comment #6)
I've created MR addressing the bug: https://gitlab.winehq.org/wine/wine/-/merge_requests/4075
Thanks Piotr, I can confirm that these patches make the generated Postscript file contain correct number of copies in the %cupsJobTicket: entry.
For the testing puposes I also selected non-defalt page size (A5), orientation (Landscape) and resolution (1200 dpi), and got %cupsJobTicket: AnsiA %%Orientation: Portrate ... %%BeginPageSetup /pgsave save def 72 1200 div 72 1200 div scale 0 13200 translate 1 -1 scale 0 rotate %%EndPageSetup
and only resolution seems to be respected. That's not related and probably should be reported in a separate bug report.
https://bugs.winehq.org/show_bug.cgi?id=55718
--- Comment #8 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to Dmitry Timoshkov from comment #7)
For the testing puposes I also selected non-defalt page size (A5), orientation (Landscape) and resolution (1200 dpi), and got %cupsJobTicket: AnsiA %%Orientation: Portrate ... %%BeginPageSetup /pgsave save def 72 1200 div 72 1200 div scale 0 13200 translate 1 -1 scale 0 rotate %%EndPageSetup
and only resolution seems to be respected. That's not related and probably should be reported in a separate bug report.
According to my limited testing besides of dmCopies and dmCollate other fields should also be copied from the first page.
https://bugs.winehq.org/show_bug.cgi?id=55718
--- Comment #9 from Piotr Caban piotr.caban@gmail.com --- (In reply to Dmitry Timoshkov from comment #7)
For the testing puposes I also selected non-defalt page size (A5), orientation (Landscape) and resolution (1200 dpi), and got
and only resolution seems to be respected. That's not related and probably should be reported in a separate bug report.
The settings you have tested are not global. It's possible to change them between pages. We're currently ignoring page size changes but it's a separate issue. Note that page orientation is working - we're rotating page content in this case.
https://bugs.winehq.org/show_bug.cgi?id=55718
--- Comment #10 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to Piotr Caban from comment #9)
(In reply to Dmitry Timoshkov from comment #7)
For the testing puposes I also selected non-defalt page size (A5), orientation (Landscape) and resolution (1200 dpi), and got
and only resolution seems to be respected. That's not related and probably should be reported in a separate bug report.
The settings you have tested are not global. It's possible to change them between pages. We're currently ignoring page size changes but it's a separate issue.
Thanks for the clarification. It would be nice to have the page size setting fixed.
Note that page orientation is working - we're rotating page content in this case.
If I recall correctly some typesetters handle page orientation in a very specific way, so handling landscape by emulating it could potentially break things.
https://bugs.winehq.org/show_bug.cgi?id=55718
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |7128a6595adc94606667c8a14f6 | |6d804918a580a Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #11 from Dmitry Timoshkov dmitry@baikal.ru --- Printing multiple page copies is fixed by 7128a6595adc94606667c8a14f66d804918a580a Thanks Piotr.
Remaning problems should be reported as separate bug reports.
https://bugs.winehq.org/show_bug.cgi?id=55718
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #12 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.19.