如何在Qt生成的PDF中添加图像链接?

时间:2018-04-08 08:46:29

标签: html c++ qt pdf-generation html-pdf

我使用以下代码生成PDF:

html="<htm><head></head><body><a href="a.html"><img src="a.png"/></a><a href="b.html">b</a></body></html>;

QTextDocument document;
document.setHtml(html);
QPrinter printer(QPrinter::PrinterResolution);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName("a.pdf");
document.print(&printer);

但是,图像上没有超链接。文字上的链接很好。如何在img元素上添加超链接?

0 个答案:

没有答案
相关问题