Important: Please read the Qt Code of Conduct -

Set printing options manually - paper size, advanced tab

  • Hello. I'd like to find out how to set Advanced printing options without forcing user to use dialog. I'm using PyQt, but it's not a binding issue here ;)

    I want to set paper size to DL Envelope, but when I do it with the code below, it doesn't modify media size in Advanced tab.
    After that line I'm starting the print dialog with @QtGui.QPrintDialog(printer)@ and I can see DL Envelope in Page size Combo box, but there is still A4 page size set at media size option in Advanced tab.

    My Operating system is Linux Mint 12, printer HP PhotoSmart C3180.

    When I leave Advanced tab as it is (with A4), my print result is zoomed (not as I want it to be), but when I change it manually in Print Dialog, the print result is ok.

    Some screenshots and shortened explanation:

    1. Page size changed via code - OK
      ! dialog)!

    2. Unmodified media size (how to modify it via code?)
      ! dialog)!

    3. Media size modified manually - I need to prevent that, I don't want to force the user to change any settings manually, is there a way to access Advanced printing options with a code?
      ! dialog)!

    Thanks for replies in advance!

  • Offtop. This thread must be posted in Language Bindings forum (because of PyQt). And remember, General & Desktop for C++.

  • Well. I'm sorry, but this problem isn't related to bindings - small portions of code should be understandable for C++ Qt programmer. I thought this issue would suit better to General & Desktop...

    Please help.

Log in to reply