QWebEnginePage::printToPdf output differs from Chrome
Solved
QtWebEngine
-
My simple html file:
<!DOCTYPE html> <html> <body> <h1 style="font-size: 100px">This is a Heading</h1> </body> </html>
When I print it to pdf in Chrome (Margins: None, Scale: Default), text fits to one line. In chromium it's same.
But printing it usingQWebEnginePage::printToPdf
withlayout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0,0,0,0));
produces pdf file containing two lines. Text is bigger. Why?
How can I make it print same file as Chrome? Or how can I make Chrome print same file asQWebEnginePage::printToPdf
?You can check pdf files on drive: https://drive.google.com/drive/folders/1-NQJGwLL9M--q7tURUdTrFXHcikR8j2C?usp=sharing