Announcement

Collapse
No announcement yet.

Printer orientation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Printer orientation

    How can I find if printer is in portrait or landscape orientation ?

    Thanks.

    Gajanan Raje
    Gajanan Raje

  • #2
    gajanan --
    if you need to "find" only, i think, easiest way is to use getdevicecaps's values.
    <font face="courier new, courier" size="3"><pre>
    #compile exe
    #register none
    #include "win32api.inc"
    function pbmain
    dim printername as asciiz * %max_path
    dim printer_hdc as long
    getprofilestring "windows", "device", ",,,", printername$, sizeof(printername$)
    printername$ = left$(printername$, instr(printername$, ",") -1)
    if printername$ = " then exit function
    printer_hdc& = createdc(byval %null, printername$, byval %null, byval %null)
    if getdevicecaps(printer_hdc, %physicalwidth) < _
    getdevicecaps(printer_hdc, %physicalheight) then _
    msgbox "portrait" else msgbox "landscape"
    deletedc printer_hdc&
    end function
    [/CODE]
    if you need to change, look




    ------------------


    [this message has been edited by semen matusovski (edited april 29, 2000).]

    Comment


    • #3
      Check out Don Dickenson's (SP?) DDOC product if you don't feel like re-inventing the wheel, I use it and it's fantastic, does everything and saves me a headache!

      http://www.basicguru.com/dickinson

      Scott

      ------------------
      Scott
      mailto:[email protected][email protected]</A>
      Scott Turchin
      MCSE, MCP+I
      http://www.tngbbs.com
      ----------------------
      True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

      Comment


      • #4
        Semen,

        That was fantastic. It worked like a charm.

        I spent half a day trying to figure out DeviceCapabilities and DocumentProperties APIs. Needless to say I haven't figured them out !!

        Thanks for your help.

        Gajanan Raje

        ------------------
        Gajanan Raje

        Comment

        Working...
        X