Simple QTextEdit printing!
-
Hello.. What is the correct way to print the content of a QTextEdit without margins in QT5.14.2?
I'm trying this way:
```
QPrinter *printer = new QPrinter();
printer->setPageSize( QPageSize( QPageSize::A4 ) );
printer->setPageMargins( 0, 0, 0, 0, QPrinter::Millimeter );
printer->setOutputFormat(QPrinter::NativeFormat);
QPrintDialog *dlg = new QPrintDialog(printer, this);
if (dlg->exec() == QDialog::Accepted) {
TE_Rel->document()->print(printer);
}But this is not respecting the function of putting 0 of margin. Something is missing?
-
Hi
Most printers have a non printable margin unless its a label printer.
Is it the same printer as with the Qt4 app and now the same code is showing a margin or
its it also another printer you test with ? -
@mrjj I'm migrating QT4 to QT5... same code and same printer. But different results. Placing a simple margin on QT5 is very difficult. Something that was supposed to be done in minutes is now turning into days. No solution at the moment. Almost giving up on migrating to QT5.