Dii
19th May 2008, 10:36
Hi!
I might be dumb, but can't figure out this... :(
So I have a nice QTextEdit... I want to print it, as in the big book:
QPrinter printer;
printer.setPageSize (QPrinter::A4); printer.setFullPage (true);
QPrintDialog *dialog = new QPrintDialog (&printer, this);
if (dialog->exec() != QDialog::Accepted) return;
print (&printer);
I see it in the PDF file, it looks fine, but the margin is too big. Looks like the setFullPage(true) does nothing. I tried several stuff, a few to notice:
Change the document's margin and print that one:
http://trolltech.com/developer/knowledgebase/faq.2008-01-17.5101025464/
Change printengine properity:
printer.printEngine()->setProperty(QPrintEngine::PPK_PaperRect, rect1);
If I try to print with the QPainter engine, it's fine and full page, just it's rather painful to work out with the painter.... and couldn't find a way to send the QTextEdit to painter.
Does anyone have any idea?
I might be dumb, but can't figure out this... :(
So I have a nice QTextEdit... I want to print it, as in the big book:
QPrinter printer;
printer.setPageSize (QPrinter::A4); printer.setFullPage (true);
QPrintDialog *dialog = new QPrintDialog (&printer, this);
if (dialog->exec() != QDialog::Accepted) return;
print (&printer);
I see it in the PDF file, it looks fine, but the margin is too big. Looks like the setFullPage(true) does nothing. I tried several stuff, a few to notice:
Change the document's margin and print that one:
http://trolltech.com/developer/knowledgebase/faq.2008-01-17.5101025464/
Change printengine properity:
printer.printEngine()->setProperty(QPrintEngine::PPK_PaperRect, rect1);
If I try to print with the QPainter engine, it's fine and full page, just it's rather painful to work out with the painter.... and couldn't find a way to send the QTextEdit to painter.
Does anyone have any idea?