简体   繁体   English

使用QPrinter :: HighResolution不打印

[英]With QPrinter::HighResolution not printing

I implement the ability to print reports in my project. 我实现了在项目中打印报告的功能。 Reports are presented as HTML content. 报告以HTML内容的形式呈现。 I use for print QWebEnginePage. 我用于打印QWebEnginePage。 I need high resolution print output for reports: 我需要用于报告的高分辨率打印输出:

QPrinter printer = new QPrinter(QPrinter::HighResolution);

But when printing with the "print" function, print fails, with message in debug: 但是,使用“打印”功能打印时,打印失败,并在调试中显示消息:

QImage: out of memory, returning null image QImage:内存不足,返回空图像

When printing with ScreenResolution, everything is fine, but the result is poor quality. 使用ScreenResolution打印时,一切都很好,但结果质量很差。 Version Qt - 5.10.1 Qt版本-5.10.1

Probably you are indeed running out of memory. 可能确实是内存不足。 Try to convert your web page into something that renders better, eg PDF and print the PDF instead. 尝试将您的网页转换为更好的外观,例如PDF并打印PDF。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM