[Bug 55670] New: Word 2007 and Wordpad are no longer able to print multiple copies of a page
https://bugs.winehq.org/show_bug.cgi?id=55670 Bug ID: 55670 Summary: Word 2007 and Wordpad are no longer able to print multiple copies of a page Product: Wine Version: 8.16 Hardware: x86-64 OS: Linux Status: NEW Keywords: regression Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs(a)winehq.org Reporter: dmitry(a)baikal.ru CC: piotr(a)codeweavers.com Distribution: --- This problem has been noticed with Word 2007 however it's also possible to reproduce with wordpad ('wine write' is a nice wrapper to run wordpad). Steps to reproduce: 1. wine write 2. Ctrl+P (File -> Print), it's fine to print empty document 3. Select "Print to file", set "Number of copies" to 2, select Pages 1 - 1 for clarity 4. Press OK, save "output.prn". When the bug is not present output.prn contains the comment %%cupsJobTicket: copies=2 otherwise this comment is missing from the generated Postscript file. According to my testing last version of Wine that was able to correctly print multiple copies is wine-7.22, wine-8.0-rc1 is already broken. It's not really possible to correctly find the offending commit because breakage has side effects like a failure to create "output.prn". If a missing output.prn could be considered as 'bad' during bisection then the regression is caused by $ git bisect bad 017e9557db73a4b51b5cb2eacbf638288b5e6719 is the first bad commit commit 017e9557db73a4b51b5cb2eacbf638288b5e6719 Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Dec 2 21:23:50 2022 +0100 localspl: Use print processor in ScheduleJob. Wine with this commit reverted writes correct "output.prn" with %%cupsJobTicket: copies=2, however using Wine with that commit leads to a missing "output.prn". P.S. wine-8.0 is not able to print to a file (missing "output.prn") wine-8.0.2 is able to create "output.prn" however %%cupsJobTicket: copies=2 is missing As a result with wine-stable it's impossible to print multiple copies of a page. I'd personally consider this bug as major, especially when stable Wine release is affected, however I'll leave to Piotr to decide. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 Piotr Caban <piotr.caban(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr.caban(a)gmail.com --- Comment #1 from Piotr Caban <piotr.caban(a)gmail.com> --- It looks like it will take some work to fix it properly. The EMF spool file format supports storing DEVMODE that contains number of copies but it's ignored on Windows. Another place that stores DEVMODE is SHD file (we currently don't create the file at all). I guess it stores information about number of copies to print. I will need to do some more testing to confirm. SHD file format is described here: https://github.com/kacos2000/WinHex_Templates/blob/master/SHD%20spool%20shad... I'm not sure if we need to be binary compatible. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 --- Comment #2 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- (In reply to Piotr Caban from comment #1)
It looks like it will take some work to fix it properly. The EMF spool file format supports storing DEVMODE that contains number of copies but it's ignored on Windows.
Do we really need to be compatibe with Windows and ignore the dmCopies field when interpreting EMF?
Another place that stores DEVMODE is SHD file (we currently don't create the file at all). I guess it stores information about number of copies to print. I will need to do some more testing to confirm.
SHD file format is described here: https://github.com/kacos2000/WinHex_Templates/blob/master/ SHD%20spool%20shadow%20file.tpl I'm not sure if we need to be binary compatible.
Why do we need to follow undocumented Windows internals? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 --- Comment #3 from Piotr Caban <piotr.caban(a)gmail.com> --- (In reply to Dmitry Timoshkov from comment #2)
Do we really need to be compatibe with Windows and ignore the dmCopies field when interpreting EMF? It's possible to reprint the document using spool file. Such change will affect this scenario. Also EMF spool file is not designed for that so we will need to delay PS file header creation until DEVMODE is read.
It will also not work if we ever add support for native print processors / printer drivers.
Why do we need to follow undocumented Windows internals? I should have written that I don't think we need to be binary compatible. On the other hand there's nothing bad in it if it's not too hard.
Anyway, this were just some notes, I still need to do more testing. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, printing -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 --- Comment #4 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- (In reply to Piotr Caban from comment #3)
Do we really need to be compatibe with Windows and ignore the dmCopies field when interpreting EMF? It's possible to reprint the document using spool file. Such change will affect this scenario.
Why should we care about this feature?
Also EMF spool file is not designed for that so we will need to delay PS file header creation until DEVMODE is read.
Does that also mean that other things selected in PrintDlgW() like paper size and resolution are no longer respected? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 --- Comment #5 from Piotr Caban <piotr.caban(a)gmail.com> --- (In reply to Dmitry Timoshkov from comment #4)
Why should we care about this feature? Because it's a valid use case.
Does that also mean that other things selected in PrintDlgW() like paper size and resolution are no longer respected? Yes, ps file header is currently written using default printer settings.
I've sent a fix for that: https://gitlab.winehq.org/wine/wine/-/merge_requests/3991 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 --- Comment #6 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- (In reply to Piotr Caban from comment #5)
Does that also mean that other things selected in PrintDlgW() like paper size and resolution are no longer respected? Yes, ps file header is currently written using default printer settings.
I've sent a fix for that: https://gitlab.winehq.org/wine/wine/-/merge_requests/3991
I can confirm that with patch applied the produced Postcript file has number of copies, resolution, paper size and orientation that match the values selected in the Print dialog. Thanks! Should this bug be targeted for the future 8.0.x stable release? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 --- Comment #7 from Piotr Caban <piotr.caban(a)gmail.com> --- (In reply to Dmitry Timoshkov from comment #6)
Should this bug be targeted for the future 8.0.x stable release? Yes.
-- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 Dmitry Timoshkov <dmitry(a)baikal.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |8.0.x CC| |mstefani(a)winehq.org --- Comment #8 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- (In reply to Piotr Caban from comment #7)
Should this bug be targeted for the future 8.0.x stable release? Yes.
Adding target milesone tag and Michael to the cc: then. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 Piotr Caban <piotr.caban(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Fixed by SHA1| |b4b39bfbd1ac160bc7d7899ae99 | |76bc45902b523 Resolution|--- |FIXED --- Comment #9 from Piotr Caban <piotr.caban(a)gmail.com> --- Marking as fixed. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 --- Comment #10 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- (In reply to Piotr Caban from comment #9)
Marking as fixed.
Confirming that printing from wordpad correctly produces the specified number of copies. Thanks Piotr. Unfortunately printing from Word 2007 is still broken. Piotr, how would you like to proceed: reopen this bug report and continue the investigation for Word, or open a separate bug report for that? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 Dmitry Timoshkov <dmitry(a)baikal.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Word 2007 and Wordpad are |Wordpad is no longer able |no longer able to print |to print multiple copies of |multiple copies of a page |a page --- Comment #11 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- (In reply to Dmitry Timoshkov from comment #10)
Unfortunately printing from Word 2007 is still broken. Piotr, how would you like to proceed: reopen this bug report and continue the investigation for Word, or open a separate bug report for that?
According to my testing printing with specified number of copies from Word 2007 is a different regression. I'll rename this bug report to mention only Wordpad. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 --- Comment #12 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- (In reply to Piotr Caban from comment #1)
It looks like it will take some work to fix it properly. The EMF spool file format supports storing DEVMODE that contains number of copies but it's ignored on Windows.
The problem in Word 2007 is caused by EMRI_DEVMODE record (which contains correct dmCopies) being written at the end of the spool file, and as a result is processed too late. Piotr, do you need a new bug report for this? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 --- Comment #13 from Piotr Caban <piotr.caban(a)gmail.com> --- Yes, please create a new bug and add me to CC. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55670 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #14 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 8.18. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=55670 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|8.0.x |--- -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla