Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. printing
    Log in to post
    • All categories
    • jeanmilost

      Unsolved Qt Quick Controls 2 - How to grab the items contained in a TableView in images in order to print them?
      QML and Qt Quick • qtquick2 printing printtopdf grab image • • jeanmilost

      1
      0
      Votes
      1
      Posts
      200
      Views

      No one has replied

    • A

      Solved Application crahes on QWebEnginePage printing attempt
      QtWebEngine • printing • • abduunn

      3
      0
      Votes
      3
      Posts
      317
      Views

      A

      @SGaist said in Application crahes on QWebEnginePage printing attempt:

      checking that the call to page returns a valid pointer.

      Thank you.

      With the clue I had from this response, and with the help of demobrowser example which is bundled with Qt-5.6 I rewrote the code and could send the page to printer successfully.

      the code after the modification:

      QWebEngineView *view = new QWebEngineView(this); view->setHtml("<h1>Hello</h1>", QUrl("about:blank")); printRequest(view->page());

      the functions are defined as following

      void MainWindow::slotHandlePagePrinted(bool result) { Q_UNUSED(result); delete printer; printer = nullptr; } void MainWindow::printRequest(QWebEnginePage *page) { if (printer) return; printer = new QPrinter(); QScopedPointer<QPrintDialog> dialog(new QPrintDialog(printer, this)); if (dialog->exec() != QDialog::Accepted) { slotHandlePagePrinted(true); return; } else { page->print(printer, [=](bool) {}); } }

      and in the header file:

      private slots: void slotHandlePagePrinted(bool result); private: QPrinter *printer; void printRequest(QWebEnginePage *page);
    • Y

      Solved Printing and positioning
      General and Desktop • printing scaling • • YuriQ

      6
      0
      Votes
      6
      Posts
      458
      Views

      Y

      Finally. This code works fine.

      void onPrint(QPrinter* printer) { QPagedPaintDevice* device = printer; QPainter painter; painter.begin(device); int w = device->width(); int h = device->height(); painter.drawLine(0,0,w,h); painter.drawLine(0,h,w,0); painter.drawEllipse(QPointF(w/2, h/2), w/10, w/10); painter.drawText(0, h, "pixels"); printer->newPage(); painter.end(); }
    • S

      Unsolved iOS printing to a printer on the network
      Mobile and Embedded • ios printing • • Shikamu

      2
      0
      Votes
      2
      Posts
      657
      Views

      No one has replied

    • P

      Unsolved Printing Problem with the Helvetica Font [Qt 5.5.1]
      General and Desktop • helvetica printing garbled print problem garbled text • • Phil_W

      7
      0
      Votes
      7
      Posts
      2781
      Views

      P

      Well this problem with garbled Helvetica in printed output (see images in prior post) is fixed if we DISABLE font embedding ... with this:

      void QPrinter::setFontEmbeddingEnabled(bool enable)

      Two questions:

      (1) Does that given any insight into the problem we are having? (This is with Qt 5.5.1).
      (2) How reasonable is it to DISABLE font embedding? Will that cause any problems for our users?

      Thanks in advance.

    • M

      Unsolved Print PDF/A Archive format
      General and Desktop • pdf printing pdfa • • m.bothmann

      2
      0
      Votes
      2
      Posts
      616
      Views

      ?

      Hi! My first thought was to use the PDF generation that Qt offers and then simply convert the produced documents to PDF/A with Ghostscript. That should go like gs -dPDFA ....

    • Vinorcola

      Printing PDF with Headers & Footers
      General and Desktop • pdf printing qtextdocument • • Vinorcola

      4
      0
      Votes
      4
      Posts
      2457
      Views

      SGaist

      You can find an example of this in the "Advanced Qt Programming: Creating Great Software with C++ and Qt 4" book code samples.

    • H

      Printing function
      General and Desktop • printing • • hbrock

      6
      0
      Votes
      6
      Posts
      1236
      Views

      SGaist

      You should check the C++ API for that. You can use Qt with native API (check the QtWinExtras module)

    • I

      QtRPT : cannot find -lQtZint
      Tools • printing • • ictlotfi

      2
      0
      Votes
      2
      Posts
      913
      Views

      SGaist

      Hi and welcome to devnet,

      Where is that library located ?

    • S

      [SOLVED]c2568 unable to reolve overload == while trying to setup a print function
      General and Desktop • printing unable to resol c2568 • • Suroh6

      3
      0
      Votes
      3
      Posts
      1234
      Views

      S

      @Chris-Kawa Thanks :)

    • R

      Printing QTextTable And QPainter
      General and Desktop • qprint qpainter print printing qt5.4 • • root0x

      1
      0
      Votes
      1
      Posts
      1298
      Views

      No one has replied

    • patrikd

      [Solved]Printing on iOS
      Mobile and Embedded • ios printing objective-c • • patrikd

      1
      0
      Votes
      1
      Posts
      1233
      Views

      No one has replied