Actually, the task is to display an HTML document in the form of one or several A4 pages (depending on the document). Need for print and print preview window. I used to use QWebView along with a standard print preview dialog - there the text is automatically transferred to the next page. But now you need another print window, therefore you need to invent something of your own. And I don’t know how to make the text automatically split.

  • Use QPrintPreviewWidget , it will break the text into pages. A tool for managing settings, incl. printing, can be implemented separately. - alexis031182
  • alexis031182, yes, thanks, now I tried - what you need. - soaup
  • Although probably not quite. The document is still printed from QWebView, and redirected to the widget via paintRequested. I would like to refuse from QWebView - when printing, it reduces the font size, and I, according to the task, should have a certain size. And the use of other means - for example, render () - did not work out precisely because it could not be paginated. - soaup
  • Then QTextEdit ( QTextDocument ). Html is supported by them, although in a limited form, difficult-composite pages are unlikely to be rendered correctly. - alexis031182
  • Yes, in a good way, this should be implemented by webkit ... - 0andriy

0