Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can't change page orientation printing to Brother label printer in Linux
Forum Updated to NodeBB v4.3 + New Features

Can't change page orientation printing to Brother label printer in Linux

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 5.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jasontiller
    wrote on last edited by
    #1

    Hi, All, :)

    My application (Ubuntu 10.04) needs to print a label. I bought the Brother QL-570 on the strength of a few positive reports of its Linux compatibility. I installed the CUPS driver and had no problem printing a test page.

    However, when I try to print from Qt, the orientation of the text is incorrect. The output is formatted using simple HTML into a QTextDocument, which is printed on a QPrinter. An excerpt of this code:

    @
    QPrinter lab_printer;
    lab_printer.setPrinterName( "QL-570-2" );

    // I'm using the provided sample roll of 29x90mm labels.
    lab_printer.setPaperSize( QSizeF( 29, 90 ), QPrinter::Millimeter );

    lab_printer.setOrientation( QPrinter::Landscape );

    // The supplied ODT template used these margins.
    lab_printer.setPageMargins( 0.11, 0.05, 0.11, 0.05, QPrinter::Inch );

    stringstream lab_html;
    lab_html << "<html><body>"
    "<p>1: a b c d e f g h i j k l m n o p q r s t u v w x y z"
    "<p>2: a b c d e f g h i j k l m n o p q r s t u v w x y z"
    "<p>3: a b c d e f g h i j k l m n o p q r s t u v w x y z"
    "<p>4: a b c d e f g h i j k l m n o p q r s t u v w x y z"
    "</body></html>";

    QTextDocument lab_doc;

    lab_doc.setHtml( lab_html.str().c_str() );

    lab_doc.print( &lab_printer );
    @

    The output in portrait mode is what you'd expect:

    !http://home.comcast.net/~tiller30/portrait.jpg(Label output in "Portrait" orientation)!

    Unfortunately, the output in landscape mode is not correct:

    !http://home.comcast.net/~tiller30/landscape.jpg(Label output in "Landscape" orientation)!

    I've verified that when printing to another printer (a Xerox Phaser) I can successfully print in landscape orientation.

    Has anyone else tried to use this printer in Linux? Brother provides an SDK, but its Windows-only.

    I'm considering trying a Dymo, which has a Linux-based SDK. Has anyone tried Dymos?

    Thanks!

    ---Jason

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved