Closed zorba77 closed 1 week ago
Confirmed :-(
May relate to #16617
May relate to musescore#16617
I don't know, I don't tried to print a landscape score, I only created a PDF. SVG and PNG export are ok. My OS is Linux.
There's this code in all PDF exporting functions:
printer.setPageOrientation(size.width() > size.height() ? QPageLayout::Landscape : QPageLayout::Portrait);
Deleting those seems to fix the issue, I just don't understand why
Hmm, https://doc.qt.io/qt-5/qpagedpaintdevice.html#setPageOrientation says:
You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new orientation to a new page. You should not call any painting methods between a call to setPageOrientation() and newPage() as the wrong paint metrics may be used.
I just wonder why that apparently wasn't a problem in MuseScore 3.6.2?
I can confirm that the issue is closed for a single page score in landscape. The error remains exporting multipage scores or score with parts. In these situations only the first page is set in landscape (if needed). I attached an old score, but this is true also for all my scores. 20_inno tedesco.zip
Darn... I had sort of anticipated that, so I made sure that this setting is done directly before all pageNew()
calls.
I'm reading the last commit,
if (!firstPage) { printer.setPageOrientation(size.width() > size.height() ? QPageLayout::Landscape : QPageLayout::Portrait); printer.newPage(); }
Maybe is this the problem? The problematic code was removed only for the first page.
I followed the Qt documentation above You should call this ..., or immediately before calling newPage()
It seems a problem only with score (portrait) with parts (landscape) in one single file, right?
void MuseScore::printFile()
could get reverted, if it ain't broke, don't fix it....setPageOrientation()
from bool MuseScore::savePdf(Score* cs_, QPrinter& printer)
!setPageOrientation()
being removed from that bool MuseScore::savePdf(Score* cs_, QPrinter& printer)
too.setPageOrientation()
calls in bool MuseScore::savePdf(QList<Score*> cs_, const QString& saveName)
being removed.We'd need someone on Mac to test this too, these savePDF()
methods do have some platform-dependant code in them
Please test, I've force-pushed it to the 3.x branch
Tests exporting PDF combined in a single file:
-export portrait score and mixed parts in separated files: OK -export landscape score and mixed parts in separated files: OK
Today I will do some experiments with printer
All on Linux that is, right?
All on Linux that is, right?
Yes, KUbuntu LTS 22.04
Fixed for Linix and Windows, let's close and reopen if Mac still has an issue
I can confirm that a landscape score is printed rightly under linux
MS 3.7 exports all pdf in portrait format, even if the score is set in landscape format. the consequence is that the pdf is cut on the right. I attached a score with 2 pdf for A4 and A5. The same happens with the parts. This is a very problematic bug, since the PDF export is essential to create parts to share.
PDF.zip