Make Table in Pdf
-
Hello
I was trying to make Pdf file with table , so with QPainter is kind of hard ! , so i chose to use it in HTML but didn't workQString html ="<html><head/><body>" "<h2 style=color: #2e6c80; text-align: center;>%1 - %2 - %3</h2>" "<p style=text-align: center;> </p>" "<p style=text-align: center;><strong> </strong></p>" "<table style=height: 212px; width=575>" "<tbody>" "<tr>" "<td>" "<h2>1-2</h2>" "</td>" "<td>" "<h2>12-1</h2>" "</td>" "<td>" "<h2>11-12</h2>" "</td>" "<td>" "<h2>10-11</h2>" "</td>" "<td>" "<h2>9-10</h2>" "</td>" "<td>" "<h2>8-9</h2>" "</td>" "<td>" "<h2>السنة</h2>" "</td>" "<td>" "<h2>ايام الأسبوع</h2>" "</td>" "</tr>" "<tr>" "<td> </td>" "<td> </td>" "<td> </td>" "<td> </td>" "<td> </td>" "<td> </td>" "<td> </td>" "<td>" "<h3>السبت</h3>" "</td>" "</tr>" "<tr>" "<td> </td>" "<td> </td>" "<td> </td>" "<td> </td>" "<td> </td>" "<td> </td>" "<td> </td>" "</tbody>" "</table>" "</body></html>"; QTextDocument document; document.setHtml(html.arg(ConfigDialog::_university,ConfigDialog::_college,ConfigDialog::_department)); QPrinter printer; printer.setPageMargins(QMarginsF(15, 15, 15, 15)); printer.setOutputFormat(QPrinter::PdfFormat); printer.setPageSize(QPrinter::A4); printer.printRange(); printer.setOutputFileName("table.pdf"); document.print(&printer);
so what i should chose?