Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qprinter

    Log in to post
    • All categories
    • M

      Unsolved Bookmark Issue when converting HTML to PDF
      General and Desktop • pdf html bookmarks qprinter • • Majed.Y

      4
      0
      Votes
      4
      Posts
      165
      Views

      batista

      @Majed-Y
      That's can do what you want....
      [link text](link url)https://github.com/qpdf/qpdf

    • SMEasy

      Solved QPrintPreviewDialog Image is not shown/Bild wird nicht gezeigt
      German • qprintpreviewdi qimage qpaint qprinter • • SMEasy

      3
      0
      Votes
      3
      Posts
      258
      Views

      SMEasy

      @A-A-SEZEN Thanks, it actually works now

    • K

      Unsolved Qt printing using html and QTextDocument
      General and Desktop • qtquick qtextdocument qprinter html pdf • • kuntio

      7
      0
      Votes
      7
      Posts
      859
      Views

      K

      syntax from documentation for border <width>px <border-style> <border-color>
      That's mean it should be px after border.

    • S

      Solved Not able to render a tableview to pdf.
      General and Desktop • qprinter painter rendering qt desktop • • sachinrd

      9
      0
      Votes
      9
      Posts
      583
      Views

      mrjj

      @sachinrd
      You are welcome.
      Do notice this way of printing it only works when it
      can fit on one page. if it has many rows, it will not be optimal :)

    • L

      Unsolved memory leak width QPainter/QPrinter
      General and Desktop • qpainter qprinter memory leak • • labrass

      18
      0
      Votes
      18
      Posts
      1116
      Views

      AaronC

      @Christian-Ehrlicher Thanks for tracking that down. Hope Qt gets it fixed soon.

    • artwaw

      Solved Printout cut from left on mac
      General and Desktop • qprinter macosx mac • • artwaw

      4
      0
      Votes
      4
      Posts
      259
      Views

      artwaw

      Thank you @SGaist , filed a bug report.

    • S

      Solved QPrinter doesn't set margins below 12mm
      General and Desktop • qprinter margins • • SimonSchroeder

      8
      0
      Votes
      8
      Posts
      1125
      Views

      S

      @mrjj I actually want to print to an actual printer. So, using a PDF in between is not an option.

      Just as I said: the margins of the QPrinter::pageLayout() do not work as one would expect. In order to be able to print close to the border, you have to turn on full page mode and set the margins of the QPrinter directly. I am not entirely sure (as I have a huge code base involved converting wxWidgets to Qt), but it looks like setting the margins of QPrinter actually prints with that margin (in contrast to what the documentation suggests). For me the problems are now solved.

    • N

      Unsolved QPrinter Support On Android
      Mobile and Embedded • qprinter printer android qt-android • • narayanan.krish

      3
      0
      Votes
      3
      Posts
      637
      Views

      M

      Hi Narayanan, Did you find any other alternative for this printer support on Android? Implementing ourselves is definitely an option but it can be quite a process if your application has to support more than 10 types of printers.
      Do let me know as it would be helpful piece of information.

    • E

      Unsolved Glyph width information is inconsistent in PDF
      General and Desktop • qprinter qpainter pdf • • euchkatzl

      2
      0
      Votes
      2
      Posts
      893
      Views

      SGaist

      Hi,

      You should check the bug report system to see if it's something known. If not please consider opening a new report providing your example and as many details as possible about your setup.

    • geor

      Unsolved OS printing error
      General and Desktop • qprinter os x • • geor

      2
      0
      Votes
      2
      Posts
      674
      Views

      A

      Take a look at QtRPT print report engine and QtRptDesigner. May be it help you.
      You can fint QtRPT at http://www.qtrpt.tk

    • P

      Solved QPainter.begin returns false on prod machine
      General and Desktop • qt5.2.1 qprinter qpainter pdf windows • • PierreFIL

      11
      0
      Votes
      11
      Posts
      4024
      Views

      P

      OK, so now that I have launched the program with admin rights and came back with user session, the application is working (?!?)

      So it was neither a DLL or plugins problem, but just a weird right access blocking. I am sad I can't explain why I had to launch it once with admin session, but at least I am glad I solved my problem.

      Thanks anyway to those who give their time to help.

    • O

      Solved Error: undefined reference to `_imp___ZN8QPrinterC1ENS_11PrinterModeE'
      General and Desktop • qprinter qprintdialog • • Olivier Ronat

      2
      0
      Votes
      2
      Posts
      5932
      Views

      mrjj

      Hi
      Do you have
      QT += printsupport

      in the .pro file ?

      Ps. If you add it. remember to run qmake.

    • Xardas

      Solved Problem with printing if "windows scaling" > 100%
      General and Desktop • qprinter windows 10 • • Xardas

      3
      0
      Votes
      3
      Posts
      1088
      Views

      Xardas

      solution

      QApplication::setAttribute(Qt::AA_Use96Dpi);
    • Donn

      Unsolved QPaintEvent in MainWindow
      General and Desktop • qprintevent qprinter qmainwindow • • Donn

      20
      0
      Votes
      20
      Posts
      9275
      Views

      Donn

      @kshegunov

      I think I got it! I have included to the painterEvent the following:

      QPixmap pm(200, 200); pm.fill(Qt::white); setPixmap(pm);

      Now I can set the text from other class like:

      ui->label->setText("lala");

      However, I think I shouldn't set Pixmap inside paintEvent - better to do it in the other class so this type of label could be also used for other labels, right?

      EDIT:

      I liked the idea of @jsulm. Could you give me some hints how to achieve it? How to get the painting functionality from a standard QLabel and then add some additional my own painting?

    • D

      Unsolved Converting Enums to Strings for QPrinter
      General and Desktop • qprinter enum qt4 qmetaobject • • DougyDrumz

      13
      0
      Votes
      13
      Posts
      4815
      Views

      D

      Let me tone down this discussion by saying that the original reason for my question has disappeared. I misunderstood how QPrinter worked. I thought I would need the string versions of the QPrintDialog enums to pass on to lp. Turns out QPrinter does what I need to do automatically and I don't need to call lp. Thanks for the lively discussion though.

    • N

      Unsolved Qwebview and printer issue(paper size)
      General and Desktop • qwebview qprinter html • • Nouriemm

      2
      0
      Votes
      2
      Posts
      1119
      Views

      N

      Anyone?
      Any Idea?

    • P

      Unsolved QPrinter causes SIGPIPE error
      General and Desktop • qml sigpipe qt 5.4.1 qprinter • • PhTe

      5
      0
      Votes
      5
      Posts
      1642
      Views

      P

      I will try to debug in QPrinter, but therefore i have to compile QT in debug mode. It will take a while..

    • P

      Unsolved PDF export heat up i.mx6
      Mobile and Embedded • i.mx6 qprinter qwebkit • • PhTe

      6
      0
      Votes
      6
      Posts
      2411
      Views

      P

      Hey,
      thanks for your help.
      It figured out, that the problem was not the export process. Sorry :)

      It was the message window i show when the export is complete.
      I dont know why but it caused the gpu to heat up even if it was closed.

    • collycrk

      Unsolved QPrinter
      General and Desktop • qprinter • • collycrk

      6
      0
      Votes
      6
      Posts
      3500
      Views

      mrjj

      Hi
      it seems you made print in MainWindow::print
      it should be in
      TestPrint::print( QPrinter* printer )

      That is why is says "print not declared in this scope" as
      u seem to have pasted the code below it ?

      That is ok. just correct code ( get rid of print call)

      so first error is that you have no print function.
      next error is that you miss the last argument for the text.
      so yes, you are close to printing :)

      if ( dialog.exec() == QDialog::Accepted ) { // create painter for drawing print page QPainter painter( &printer ); int w = printer.pageRect().width(); int h = printer.pageRect().height(); QRect page( 0, 0, w, h ); // create a font appropriate to page size QFont font = painter.font(); font.setPixelSize( (w+h) / 100 ); painter.setFont( font ); // draw labels in corners of page painter.drawText( page, Qt::AlignTop | Qt::AlignLeft, "QSimulate" ); painter.drawText( page, Qt::AlignBottom | Qt::AlignLeft, QString(getenv("USER")) ); //painter.drawText( page, Qt::AlignBottom | Qt::AlignRight, // QDateTime::currentDateTime().toString( Qt::DefaultLocaleShortDate ) ); // draw simulated landscape page.adjust( w/20, h/20, -w/20, -h/20 ); painter.drawText( &painter, page ); //testprint.cpp:78: error: no matching function for call to 'QPainter::drawText(QPainter*, QRect&)' // here you have no text?? // look at the others, you need the last argument } ^