Announcement

Collapse
No announcement yet.

funny XPRINT thing with laserjet

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

  • funny XPRINT thing with laserjet

    The following compileable 8.04 code, extracted from an application of mine, creates TWO pages of output on my HP laserJet 1020. If I comment out the XPRINT SET ORIENTATION line then a single page results. Funnily enough, other non-PB applications which I use do not result in a blank page being printed first, even when the orientation appears to have been changed.

    I would prefer not to have to ditch XPRINT, as I have an investment of time in the application, but this blank page makes the application look inept.

    Am I misusing XPRINT? Expecting too much of XPRINT? Will there be a happy ending?

    Code:
    #COMPILE EXE
    #DIM ALL
    #INCLUDE "WIN32API.INC"
    
    %IDD_DIALOG1 = 101
    
    CALLBACK FUNCTION ShowDIALOG1Proc()
    
        SELECT CASE AS LONG CBMSG
            CASE %WM_INITDIALOG
                 XPRINT ATTACH "laserjet"
                 XPRINT FONT "Courier New", 10, 0
                 XPRINT SET ORIENTATION 2
                 XPRINT : XPRINT :XPRINT "hello world!";
                 XPRINT CLOSE
    
        END SELECT
    END FUNCTION
    '----------------------------------------------------
    FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
        LOCAL lRslt AS LONG
        LOCAL hDlg  AS DWORD
    
        DIALOG NEW hParent, "LaserJet 1020 XPRINT test", 70, 70, 201, 121, %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR _
            %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_CONTROLPARENT _
            OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR, TO hDlg
        DIALOG SHOW MODAL hDlg, CALL ShowDIALOG1Proc TO lRslt
        FUNCTION = lRslt
    END FUNCTION
    '================================================
    FUNCTION PBMAIN()
        ShowDIALOG1 %HWND_DESKTOP
    END FUNCTION

  • #2
    Try setting the orientation before you set the font.

    It may be that setting the font requires some kind of "new page" or "end of prior page" thingee and if that occurs AFTER the orientation is set you may not see the deleterious effects observered to date.

    Hell, it's a thought anyway; and for sure darned easy to try.
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Shot in the Dark

      Hi Chris;

      I notice that you have 3 XPRINT commands.

      "XPRINT : XPRINT :XPRINT "hello world!";"

      Perhaps, one of the blank XPRINT commands is acting like a form feed.

      Comment


      • #4
        Chris, how about using XPRINT ATTACH CHOOSE, and selecting the printer yourself?

        Comment


        • #5
          XPRINT SET ORIENTATION must be executed before any other XPRINT statements on a page. It must immediately follow an XPRINT ATTACH or XPRINT FORMFEED. Otherwise, the intervening statements give PowerBASIC the impression that the current printer page has been drawn on and must be ejected from the printer.
          Sincerely,

          Steve Rossell
          PowerBASIC Staff

          Comment


          • #6
            XPRINT SET ORIENTATION must be executed before any other XPRINT statements ...
            Your reply looks like the "remarks" section for the XPRINT SET ORIENTATION help.

            Well, the remarks in the next release of the help file, anyway.....
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              Originally posted by Steve Rossell View Post
              XPRINT SET ORIENTATION must be executed before any other XPRINT statements on a page.
              That works, thanks Steve!

              Comment


              • #8
                Originally posted by Michael Mattias View Post
                Try setting the orientation before you set the font.

                It may be that setting the font requires some kind of "new page" or "end of prior page" thingee and if that occurs AFTER the orientation is set you may not see the deleterious effects observered to date.
                Not to quarrel with "On High", but Xprint allows the font to be changed any number of times on the same page (even on the same line I think). Changing the font does not, by itself, force a form feed.

                ============================================
                "A dog is the only thing on earth
                that loves you more than he loves himself."
                Josh Billings
                ============================================
                Last edited by Gösta H. Lovgren-2; 1 May 2008, 08:20 PM. Reason: Gone to the dogs
                It's a pretty day. I hope you enjoy it.

                Gösta

                JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
                LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

                Comment


                • #9
                  Chris, Thanks for your post. Had the same problem here on a landscape form.

                  Steve, thanks for your answer.
                  Client Writeup for the CPA

                  buffs.proboards2.com

                  Links Page

                  Comment

                  Working...
                  X