Hi all,

I am sending to printer a text file which has been already loaded using the code as follows:
Qt Code:
  1. QString txtFile(txtlFile);
  2.  
  3. QFile txtFileOut(txtFile);
  4. txtFileOut.open(QFile::ReadOnly | QFile::Text);
  5. QTextStream txtFileIn(&txtFileOut);
  6. QString txtFileToQString(txtFileIn.readAll());
  7.  
  8. QTextDocument *document = new QTextDocument(txtFileToQString);
  9.  
  10. QPrinter printer;
  11.  
  12. QPrintDialog *dlg = new QPrintDialog(&printer, this);
  13. if (dlg->exec() != QDialog::Accepted)
  14. return;
  15.  
  16. document->print(&printer);
To copy to clipboard, switch view to plain text mode 

How can I add header text and footer text to each page printed ??
Thank you very mutch for you contribute..
Roby