Google Answers Logo
View Question
 
Q: [Qt4,VC++2005] Printing a QTextBrowser with *headers and footers* ( No Answer,   0 Comments )
Question  
Subject: [Qt4,VC++2005] Printing a QTextBrowser with *headers and footers*
Category: Computers > Programming
Asked by: fgg01-ga
List Price: $30.00
Posted: 06 Jun 2006 06:49 PDT
Expires: 06 Jun 2006 23:37 PDT
Question ID: 735708
I am currently making a small project using Visual c++ 2005 and qt4...
It generates reports in html format and then shows it in a QTextBrowser
and then prints it.
The only problem is that I don't know how to print *headers* and
*footers* on each page in an easy way.
If someone could give me a solution that will allow me to do such a
thing... I would really appreciate.

Clarification of Question by fgg01-ga on 06 Jun 2006 06:58 PDT
text is a QTextBrowser
htmlcode is a QString

Creation of the report:
======================

QString htmlcode = "<html><...a long html code of a few pages></html>
text->setHtml(htmlcode);

Printing of the report:
======================
	QTextDocument *document = text->document();
    QPrinter printer(QPrinter::HighResolution);

	QPrintDialog *dialog = new QPrintDialog(&printer,this);
	dialog->setWindowTitle(tr("Send to printer"));
	if (dialog->exec() != QDialog::Accepted)
		return;
	printer.setFullPage(true);
	printer.setPageSize(QPrinter::A4);
	document->print(&printer);


===

So this works, but I need to add headers and footers on each page...
Thanks

Please note that I don't want headers and footers to be in the html
page. Because if you modify the page, headers and footers would not be
correctly placed on the page.

If you need any clarification about my request, simply ask me!

Clarification of Question by fgg01-ga on 06 Jun 2006 23:18 PDT
$30 will be my highest price :)
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy