Wine prints to A4 even though it says US Letter in Office

Questions about Wine on Linux
Locked
ndgeek
Level 2
Level 2
Posts: 10
Joined: Tue Jul 03, 2012 11:21 am

Wine prints to A4 even though it says US Letter in Office

Post by ndgeek »

CUPS Defaults: job-sheets=none, none media=na_letter_8.5x11in sides=one-sided

I have a pretty much clean 1.5.9 prefix set up with Office 2010 installed. I installed allfonts and msxml3 via winetricks, and I overrode riched20.dll, but the rest is default.

Word 2010 and Outlook 2010 display US Letter as selected paper type. After clicking "Print" the printer displays some error about being out of A4 paper (it's not configured to use A4 except by manual feed via Tray 1, US Letter is in tray 2, US Legal is in tray 3). Nowhere in the chain can I find anything that actually says it's using A4. I can print from native applications without a problem (I just printed this window as a test from Chromium). I can also print from Word 2007 installed in a Crossover Office bottle (9.1.0). Notepad (wine notepad) from the Office prefix displays the letter type as A4, though.

Is there some trick to telling Wine to use US Letter? Is there some sort of registry hack I can use?
ndgeek
Level 2
Level 2
Posts: 10
Joined: Tue Jul 03, 2012 11:21 am

Re: Wine prints to A4 even though it says US Letter in Offic

Post by ndgeek »

I've done a fresh install in 1.5.11, and I'm still having trouble with this. Anyone have any ideas?
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Re: Wine prints to A4 even though it says US Letter in Offic

Post by lahmbi5678 »

There's already a bug report, see http://bugs.winehq.org/show_bug.cgi?id=21864 . You may add your experience there. It might be interesting, if Codeweavers CXOffice is having the same issue. Would it help, if you choose a tray in the printer dialog?
ndgeek
Level 2
Level 2
Posts: 10
Joined: Tue Jul 03, 2012 11:21 am

Re: Wine prints to A4 even though it says US Letter in Offic

Post by ndgeek »

Heh...I'm "Justin R" that posted to that bug a day before your forum post. I probably should have updated here. Thanks for the suggestion, though.
ndgeek
Level 2
Level 2
Posts: 10
Joined: Tue Jul 03, 2012 11:21 am

Re: Wine prints to A4 even though it says US Letter in Offic

Post by ndgeek »

Seeing this did prompt me to start investigating further...I discovered that if I set LC_ALL in my environment's locale, a new "bottle" will set the correct printer settings. Is it possible to fix my existing bottle?
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Wine prints to A4 even though it says US Letter in Offic

Post by oiaohm »

http://wiki.winehq.org/UsefulRegistryKeys
ndgeek check printing under the registry particular the printer itself and make sure that information is correct.

MS Office 2010 can be a complete pain in ass showing one paper format and printing on something completely different evey under Windows. Yes highly annoying when you have a printer with multi printer trays with like A4 and A5 here. You have requested A5 and it prints A4 or the reverse.

If the printer was set A4 when wine detected it the printer default will be wrong and notepad will be showing this. MS Office 2010 lies through teeth basically and displays suggest format. Not what it is going to print on. So when notepad shows the right thing MS Office will most likely behave itself.
ndgeek
Level 2
Level 2
Posts: 10
Joined: Tue Jul 03, 2012 11:21 am

Re: Wine prints to A4 even though it says US Letter in Offic

Post by ndgeek »

Everything in the registry from that page looks correct. I've also checked some Windows forums and found other locale settings, but those appear correct too. It looks like I may be out of luck :-/

It's slightly comforting to know that the Office thing isn't a Wine thing, at least.
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Re: Wine prints to A4 even though it says US Letter in Offic

Post by lahmbi5678 »

Hi,

did you happen to play around with some settings like using different trays? If your printer has trays, you should find these options deep in the bowels of the printer dialog.
ndgeek
Level 2
Level 2
Posts: 10
Joined: Tue Jul 03, 2012 11:21 am

Re: Wine prints to A4 even though it says US Letter in Offic

Post by ndgeek »

I've played with the tray settings, but by default it sends letter type and lets the printer pick the tray. The issue is that everything is defaulting to A4, and I can't find any way to change it.
atlpcug
Newbie
Newbie
Posts: 2
Joined: Thu Jul 09, 2009 7:28 am

Re: Wine prints to A4 even though it says US Letter in Offic

Post by atlpcug »

I've struggled for years with WINE applications defaulting to A4, though sometimes new WINE installations default correctly to Letter. I finally found a solution:

in all sub-subdirectorires of ~/.wine/drive_c/windows/system32/spool/drivers locate all the *.ppd files. Within those files there are several lines reading "Default....: A4" Change A4 to Letter. eg, DefaultImageableArea: A4; DefaultPaperDimension: A4; DefaultPageSize: A4; DefaultPageRegion: A4. Do not change any A4 that is not preceded by Default because those are definitions.

For each .ppd file that has been modified, change file permissions to "read only" or else Windows will change the .ppd file defaults back to A4.

I'm still not sure why the defaults are set to A4 when CUPS is set to Letter or resets to A4 when a Windows application is run while every Linux-based program properly shows Letter. Still, the above solution worked for me in all WINE applications that were previously problematic with the A4 default.
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Wine prints to A4 even though it says US Letter in Offic

Post by oiaohm »

atlpcug the issue is historic hang overs and Microsoft Windows developer.

ndgeek I had forgotten about the ppd files.

atlpcug wine will re get the ppd files if they are deleted. So less chance of I stuff up editing is delete all in ppd files in sub-subdirectorires of ~/.wine/drive_c/windows/system32/spool/drivers and run like notepad and bring up the printer dialog then go and change them all to read only to prevent windows applications changing it.

The historic hang overs. A long long time ago back in the Linux Hobbyist age (that is pre 1998). It was common to print to printers under Linux and BSD without using a print server. So no cups. This required applications to maintain there own settings for the printers they would be using. Printing code base in wine is older than 1998 so was designed to deal with case of no cups server. Issue is wine is still not dealing well with the existence of a cups server but its not this fault alone.

Microsoft insanity. Postscript printer drivers under windows are expected to have readable and editable ppd files for old applications. Why when old applications change settings they can edit the ppd files and are also meant to remember to undo the changes. Yes it possible to create a race condition under windows if you are printing 2 documents at exactly with different printer setting on the same printer at the same time and you are administrator. Wine is having to emulate a highly broken printer system so old applications can print.

With a limited user account in XP/2003 and latter altering the ppd files is forbin so new applications are not going to die due to ppd files locked read only. But some older applications are going to die or go into a never ending loop if the ppd file cannot be edited.

Mind you it would be worth a bug report to request an option to always make ppd files read only in registry and option to refresh ppd files to what ever is current.

atlpcug yes the fact wine print que is standalone instead of intergrating + Microsoft spool design foolish with postscript printers is the cause of problem.

Yes some of the strangeness you see in Windows MS Office 2010 under windows also goes back to the messes in the NT print que.
Locked