Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.7.1
-
None
-
Windows 7 through 10
Qt 5.7.1
Description
We currently use wkhtmltopdf's C++ library to convert HTML to a PDF. However it has various bugs, such as fonts being compressed horizontally and rendering too large.
I tested with
QWebEnginePage->printToPdf()
and it does not have these font issues; it renders correctly. However, Qt's printToPdf() does not support headers/footers, and it adds a "PAGE 2:" label at the top-left page 2 (and so on for each page), and there is no way to disable or customize this.
It would be a perfect solution for us if there were a way to specify custom headers/footers per page (I supply the HTML). Long-term we'd need to be able to have different headers/footers used depending on the pager number.
The way I see this working is I provide getHeader(short pageNum) and getFooter(short pageNum) callbacks to printToPdf() that return HTML for those headers/footers. I'd also need to be able to specify margins and how much of the page the header/footer takes up.