Nightly 2.0 printing shifted to the right

• Dec 17, 2014 - 14:44
Type
Functional
Severity
S4 - Minor
Status
closed
Project

When printing scores, if a score is setup as Letter with 10/10 left/right margins and 10/20 top/bottom margins, the page is coming out shifted about 4-5mm to the right, as well as too tall by about 5mm top and bottom. So the margins seem to be left:15, right:5, and top/bottom are about 5 mm less each.

Windows 8.1u1 64bit, latest nightly build, but it's been a problem for a while. Printer is an HP Laserjet 4350 on an Active Directory network (HP universal drivers) over which I have no control.


Comments

One error I made: the top/bottom margins are larger when I print, not smaller, so the page is more compressed but still close to centered top to bottom. If I have set 10mm for the top and 10mm for the bottom, the top seems to be ~16mm and the bottom is ~14 mm. Given measurement discrepancies, this could be 15 and 15.

My first theory was that the wrong page size was being used for calculations (A4 instead of letter), but I can't find a page size that fits something shorter than letter by ~10mm, and somewhat wider. The width of the systems is the same on both pages, ~195mm measured from left bracket to right barline.

May I be so bold as to suggest this particular problem with the whole score shifting to the right has been fixed? Or, is there something else connected to the problem that is not presented here?

It was not something everyone saw - might have been OS dependent, printer-driver-specific, not sure we really ever figured that out. So just because you don't currently see (I assume you don't?) doesn;'t necessarily mean it is fixed.

I was having the issue. After stepping away from using the program for a few days (weeks?), I downloaded the latest nightly and no longer saw an issue.

I build the latest code every day and the problem has not gone away, not even with a factory reset. The horizontal shift is most evident when a page is done with the same margins left and right (say 10 mm). The result in left=~15, right=~5. and there is vertical compression as well.

Shift on print problem still happens with Qt 5.4.1, latest build (git 201c75c), full recompile, factory reset.

My work printer is an HP LaserJet 4350 running "HP Universal Printing PS (v5.6.5)" driver. My home printer is an HP LaserJet P3005 using "HP LaserJet P3004/P3005 PCL6 Class driver". So the drivers are very different (Postscript vs PCL). Note this issue does not happen with 1.3 on the same printers and the same drivers.

I have also been seeing something else that _could_ be related. A new score will always start with the following Odd Page margins: left=10, right=15.9 (!), top=10, bottom=20. The RIGHT margin number makes no sense as it is the opposite margin where you would hole-punch, yet it is the larger margin. I would expect that the RIGHT margin (and the linked Even Page left margin) value should be 10. Has this been reported, or are others seeing this?

@schepers can you open another bug report? also can you state the default page size of a new score? and make sure you create the score with "Choose instruments" and not a template? What's your country and is your machine aware of your country ?

I am trying to understand this, but am struggling. Everything *seems* right in the code, hard to see how it could not work, actually. Unless it's a Qt bug with the FullPage setting that is causing the printers internal margins to be applied in certain cases.

Can people with access to multiple OS's and/or multiple printers test to see which combinations do and don't show the problem?

I'm also trying to understand why this would only be showing up for people with Letter size paper. That could be a total coincidence, or maybe that's something relevant about the bug. Would love to get some explicit confirmation one way or the other from people using other paper sizes.

First of all: I noticed a change on this issue on August 26.
One interesting point, with the following steps, on this Nightly: bc506ed

1) New score -> Layout -> Page Settings
2) Change Page Size: A4 -> Letter
3) Apply -> Ok, letter format is displayed on the score
4) Return to Page Settings: letter format is saved
Result for printing: off center to the right (almost no margin right : approximately 2mm?)

With this one, which could be involved (? "Pagesettings.cpp): b6480b7

And with the same steps, the step #3 (Apply) does not work ->
Return to Page Settings page: A4 format is still there.

For printing: the result is "correct" (it is centered). Centered in A4 format? Sorry, I never use the Letter format, and I do not manage to see the real difference between the two formats for printing?

However, does it help for the moment? A first step for explanation or not?

Thanks for the investigation. There was indeed a bug with the Page Settings dialog that was fixed, but I don't think that's the problem here. Or maybe it is and I don't realize it yet. I am still woirking on understanding this.

A4 and Letter are different sizes of paper. A4 paper is never used in the US; Letter paper is a little wider and a little shorter.

Since I am assuming you don't have any Letter sized paper, and your printer may or may not support it anyhow (although it probably does), can you please test just using A4? For me, even if I specific A4 page size, and then print to PDF using PDFCreator (since I don't own any A4 paper to test with), I get the same shifted-to-the-right behavior that I do with Letter paper. So as far as I can tell, paper size has nothing to do with it. If I am right, you should see the exact same effect - print shifted to the right - when simply printing using all default settings. If you don't - if your scores look centered - that is important information I need to know in order to help me understand what could be happening.

I have what appears to be a fix. I think it potentially affects all platforms, or at least, the behavior may be undefined. Still trying to understand if this is a Qt bug or something we are not doing correctly.

In MuseScore::printFile(), we set the printer to full page mode:

https://github.com/musescore/MuseScore/blob/a73cb49437ce098c2560bb42b2a…

But even after this call, the page margins on printerDev are still non-zero. Apparently setting full page mode gives us the *ability* to force the printer margins to zero, but it doesn't necessarily do it for us. My read of the documentation says we shouldn't *need* to set margins explicitly to 0, but doing so fixes the problem, and it seems harmless, so I propose doing it for all platforms to be safe.

Will submit PR after doing a little more research.

And yet this issue was not in 1.x, through many revisions of Qt. Weirder and Weirder. I hope your fix does it. Twill need to be tested using the various print options (direct to printer, PDF, SVG, PNG image, etc).

Wonderful Marc, seems fixed! SVG, PDF, PNG and direct printing work fine now under Windows 8.1u1 64bit. Tested with various margin values.