diff --git a/src/printsupport/dialogs/qpagesetupdialog_win.cpp b/src/printsupport/dialogs/qpagesetupdialog_win.cpp
index d7004ec3f1..65810d4f77 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_win.cpp
+++ b/src/printsupport/dialogs/qpagesetupdialog_win.cpp
@@ -133,7 +133,10 @@ int QPageSetupDialog::exec()
             // Make sure memory is allocated
             if (ep->ownsDevMode && ep->devMode)
                 free(ep->devMode);
-            ep->devMode = (DEVMODE *) malloc(devModeSize);
+            auto *devMode = reinterpret_cast<DEVMODE *>(malloc(devModeSize));
+            QWin32PrintEnginePrivate::initializeDevMode(devMode);
+            qDebug() << __FUNCTION__ ;
+            ep->devMode = devMode;
             ep->ownsDevMode = true;
 
             // Copy
diff --git a/src/printsupport/dialogs/qprintdialog_win.cpp b/src/printsupport/dialogs/qprintdialog_win.cpp
index 6ac3bea4c0..038dccae1f 100644
--- a/src/printsupport/dialogs/qprintdialog_win.cpp
+++ b/src/printsupport/dialogs/qprintdialog_win.cpp
@@ -49,6 +49,11 @@ static void qt_win_setup_PRINTDLGEX(PRINTDLGEX *pd, QWindow *parentWindow,
     DEVMODE *devMode = d->ep->devMode;
 
     if (devMode) {
+        qDebug() << __FUNCTION__
+                 << QString::fromWCharArray(devMode->dmDeviceName)
+                 << "or=" << devMode->dmOrientation
+                 << "dmPaperSize=" << devMode->dmPaperSize
+                 << "dmFields=0x" << Qt::hex << devMode->dmFields;
         int size = sizeof(DEVMODE) + devMode->dmDriverExtra;
         pd->hDevMode = GlobalAlloc(GHND, size);
         {
diff --git a/src/printsupport/platform/windows/qprintengine_win.cpp b/src/printsupport/platform/windows/qprintengine_win.cpp
index 681f58903e..c8cc8534da 100644
--- a/src/printsupport/platform/windows/qprintengine_win.cpp
+++ b/src/printsupport/platform/windows/qprintengine_win.cpp
@@ -862,6 +862,9 @@ void QWin32PrintEnginePrivate::initialize()
         return;
     }
 
+    qDebug() << __FUNCTION__ << "pInfo->pDevMode=" << pInfo->pDevMode
+             << "DM_SPECVERSION=" << DM_SPECVERSION;
+
     devMode = pInfo->pDevMode;
 
     if (!devMode) {
@@ -875,6 +878,11 @@ void QWin32PrintEnginePrivate::initialize()
         LONG result = DocumentProperties(NULL, hPrinter, (LPWSTR)printerName.utf16(),
                                          NULL, NULL, 0);
         devMode = (DEVMODE *) malloc(result);
+        QWin32PrintEnginePrivate::initializeDevMode(devMode);
+        qDebug() << __FUNCTION__ << devMode << " alloced sz=" << devMode->dmSize
+                 << ">or=" << devMode->dmOrientation
+                 << "dmPaperSize=" << devMode->dmPaperSize
+                 << "dmFields=0x" << Qt::hex << devMode->dmFields;
         ownsDevMode = true;
 
          // Get the default DevMode
@@ -887,6 +895,14 @@ void QWin32PrintEnginePrivate::initialize()
             ownsDevMode = false;
         }
     }
+    qDebug() << __FUNCTION__ << " after DocumentProperties/init"
+             << devMode <<  QString::fromWCharArray(devMode->dmDeviceName)
+             << "sz=" << devMode->dmSize
+             << "vers=" << devMode->dmSpecVersion
+             << ">or=" << devMode->dmOrientation
+             << "dmPaperSize=" << devMode->dmPaperSize
+             << "dmFields=0x" << Qt::hex << devMode->dmFields;
+
 
     hdc = CreateDC(NULL, (LPCWSTR)printerName.utf16(), 0, devMode);
 
@@ -913,6 +929,13 @@ void QWin32PrintEnginePrivate::initialize()
 #endif // QT_DEBUG_DRAW || QT_DEBUG_METRICS
 }
 
+void QWin32PrintEnginePrivate::initializeDevMode(DEVMODE *devMode)
+{
+    memset(devMode, 0, sizeof(DEVMODE));
+    devMode->dmSize = sizeof(DEVMODE);
+    devMode->dmSpecVersion = DM_SPECVERSION;
+}
+
 void QWin32PrintEnginePrivate::initHDC()
 {
     Q_ASSERT(hdc);
@@ -1018,6 +1041,14 @@ static int indexOfWindowsId(const QList<QPrint::InputSlot> &inputSlots, int wind
 void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &value)
 {
     Q_D(QWin32PrintEngine);
+
+    qDebug() << __FUNCTION__ << d->devMode
+             << QString::fromWCharArray(d->devMode->dmDeviceName)
+             << "sz=" << d->devMode->dmSize
+             << ">or=" << d->devMode->dmOrientation
+             << "dmPaperSize=" << d->devMode->dmPaperSize
+             << "dmFields=0x" << Qt::hex << d->devMode->dmFields;
+
     switch (key) {
 
     // The following keys are properties or derived values and so cannot be set
@@ -1052,6 +1083,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
             if (!d->devMode)
                 break;
             d->devMode->dmCollate = value.toBool() ? DMCOLLATE_TRUE : DMCOLLATE_FALSE;
+            d->devMode->dmFields |= DM_COLLATE;
             d->doReinit();
         }
         break;
@@ -1061,6 +1093,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
             if (!d->devMode)
                 break;
             d->devMode->dmColor = (value.toInt() == QPrinter::Color) ? DMCOLOR_COLOR : DMCOLOR_MONOCHROME;
+            d->devMode->dmFields |= DM_COLOR;
             d->doReinit();
         }
         break;
@@ -1086,15 +1119,19 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
         switch (mode) {
         case QPrint::DuplexNone:
             d->devMode->dmDuplex = DMDUP_SIMPLEX;
+            d->devMode->dmFields |= DM_DUPLEX;
             break;
         case QPrint::DuplexAuto:
             d->devMode->dmDuplex = d->m_pageLayout.orientation() == QPageLayout::Landscape ? DMDUP_HORIZONTAL : DMDUP_VERTICAL;
+            d->devMode->dmFields |= DM_DUPLEX;
             break;
         case QPrint::DuplexLongSide:
             d->devMode->dmDuplex = DMDUP_VERTICAL;
+            d->devMode->dmFields |= DM_DUPLEX;
             break;
         case QPrint::DuplexShortSide:
             d->devMode->dmDuplex = DMDUP_HORIZONTAL;
+            d->devMode->dmFields |= DM_DUPLEX;
             break;
         default:
             // Don't change
@@ -1122,6 +1159,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
             break;
         d->num_copies = value.toInt();
         d->devMode->dmCopies = d->num_copies;
+        d->devMode->dmFields |= DM_COPIES;
         d->doReinit();
         break;
 
@@ -1129,7 +1167,9 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
         if (!d->devMode)
             break;
         QPageLayout::Orientation orientation = QPageLayout::Orientation(value.toInt());
+        qDebug() << __FUNCTION__ << orientation;
         d->devMode->dmOrientation = orientation == QPageLayout::Landscape ? DMORIENT_LANDSCAPE : DMORIENT_PORTRAIT;
+        d->devMode->dmFields |= DM_ORIENTATION;
         d->m_pageLayout.setOrientation(orientation);
         d->updateMetrics();
         d->doReinit();
@@ -1322,6 +1362,10 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
 
     // No default so that compiler will complain if new keys added and not handled in this engine
     }
+
+    qDebug() << __FUNCTION__ << "<or=" << d->devMode->dmOrientation
+             << "dmPaperSize=" << d->devMode->dmPaperSize
+             << "dmFields=0x" << Qt::hex << d->devMode->dmFields;
 }
 
 QVariant QWin32PrintEngine::property(PrintEnginePropertyKey key) const
diff --git a/src/printsupport/platform/windows/qprintengine_win_p.h b/src/printsupport/platform/windows/qprintengine_win_p.h
index 54e3cf2814..8488f3b2c4 100644
--- a/src/printsupport/platform/windows/qprintengine_win_p.h
+++ b/src/printsupport/platform/windows/qprintengine_win_p.h
@@ -127,6 +127,8 @@ public:
        is handled in the next begin or newpage. */
     void doReinit();
 
+    static void initializeDevMode(DEVMODE *);
+
     bool resetDC();
 
     void strokePath(const QPainterPath &path, const QColor &color);
