Results 1 to 2 of 2

Thread: QPrinter, wrong paper size.

  1. #1
    Join Date
    Dec 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QPrinter, wrong paper size.

    I try to print using QPrinter (on Brother QL-500)
    When I choose paper size in QPrintDialog, template will be printed. But it'll be cut if ticket longer than some size. I set only width of paper, but the height of all tickets is the same. When I try to get size of paper (QSizeF QPrinter::paperSize ( Unit unit ) const), I'll get negative values.
    If I set paper size manually (void QPrinter::setPaperSize ( const QSizeF & paperSize, Unit unit )) I'll get a printer error abount wrong paper size. Paper size is the same as in QPrinterDialog.

    Can I print on Brother QL-500 using Qt?
    Thx

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QPrinter, wrong paper size.

    Quote Originally Posted by Sahab View Post
    I try to print using QPrinter (on Brother QL-500)
    When I choose paper size in QPrintDialog, template will be printed. But it'll be cut if ticket longer than some size. I set only width of paper, but the height of all tickets is the same. When I try to get size of paper (QSizeF QPrinter::paperSize ( Unit unit ) const), I'll get negative values.
    What values? I could perhaps expect a -1, or something similar, for the paper height because the paper is a continuous roll and therefore of indeterminate length. I also expect the printer will have some arbitrary upper limit. I don't have this printer so I can only guess.
    If I set paper size manually (void QPrinter::setPaperSize ( const QSizeF & paperSize, Unit unit )) I'll get a printer error abount wrong paper size. Paper size is the same as in QPrinterDialog.
    What size? Where do you see this error message? What does printerState() return?

    Can I print on Brother QL-500 using Qt?
    Probably.

    Post an actual small test program that shows what the paperRect() and pageRect() are by default. Also show how you attempt to set it, and what the values are afterward.

    Is there a printer-specific mechanism to cause the label roll to be cut?

Similar Threads

  1. How do I set a custom page/paper size in QPrinter
    By alferjaani in forum Qt Programming
    Replies: 7
    Last Post: 26th July 2013, 04:42
  2. How to set paper size in QPrinter (example)
    By arreman in forum Qt Programming
    Replies: 2
    Last Post: 22nd August 2011, 05:43
  3. QPrinter: Print vs. PDF paper size
    By LynneV in forum Qt Programming
    Replies: 0
    Last Post: 3rd February 2011, 15:15
  4. How I setup QPrinter paper margins
    By vcp in forum Qt Programming
    Replies: 3
    Last Post: 15th May 2008, 17:43
  5. Replies: 16
    Last Post: 25th April 2006, 12:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.