Combining Two PDF Files
-
My HTML Code :
<!DOCTYPE html>
<html>
<head>
<style>
.logo {
width: 150px;
height: 120px;}
.logoHeader {
height: 120px;
vertical-align: middle;
text-align: center;
}.floatLeft { float: left; }
.floatRight { float: right; }
</style>
</head>
<body><header>
<img class="logo floatLeft" src="Logo.png" alt="Logo" /><img class="logo floatRight" src="Data.gif" alt="Logo" /> <h1 class="logoHeader">REPORT</h1>
</header>
</body>
</html> -
This is my QT Code :
QFile styleFile( "widget.qss" );
styleFile.open( QFile::ReadOnly );
QString hex = QString::fromLatin1( styleFile.readAll() );
styleFile.close();
QTextDocument document;
QTextDocument document1;
QString data = ui->teData->toPlainText();
document.setHtml(hex.append(data));
QPrinter printer;
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setPaperSize(QPrinter::A4);
printer.setOutputFileName("test.pdf");
QPainter painter;
painter.begin(&printer);
painter.setBrush(Qt::transparent);
painter.end(); -
Hi,
To add header and footer I use the C library of https://wkhtmltopdf.org/ -
This post is deleted!