1

I use the following code to generate 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);

However, there is no hyperlink on the image. The link on the text is good. How to add hyperlink on img element?

peter
  • 379
  • 2
  • 6
  • 16
  • Qt print to pdf is not for creating pdf formatted documents , you need more [Handling pdf with Qt](https://wiki.qt.io/Handling_PDF) – Mohammad Kanan Apr 11 '18 at 08:19

0 Answers0