Apparently Qt 5.10.1 has a regression in one of the QWebEnginePage::printToPdf methods. The printToPdf(resultCallback, pageLayout) variant seems to ignore the page margins set via pageLayout and creates PDF documents with zero margins. The printToPdf(filePath, pageLayout) variant works as expected.
With Qt 5.9.4 the PDF documents created by both variants are absolutely identical.
I attached an example application that generates PDF files from an example page using both print methods. The saved PDF files "should" be identical, but with Qt 5.10.1 the callback print method always creates a PDF without margins.