Results 1 to 22 of 22

Thread: Printer riddle [Not QUITE resolved]

  1. #1

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Printer riddle [Not QUITE resolved]

    I have a (HP Deskjet) printer connected to a networked computer. I run my app on this computer and print 2 coordinate axes and a number of cross-shaped marks labelled with small tags next to them. If I then run the app from another computer in the net and send the output to the same printer, the printed sheet has the y axis reversed, i.e. everything is ok except that the vertical coordinate y has been changed to -y.

    Any ideas why this is happening?
    Last edited by krtxmrtz; Dec 16th, 2003 at 01:34 PM.

  2. #2

  3. #3

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573
    The only difference I could spot was, the printer that prints ok had the paper size set to Letter whereas the one that inverts the y axis had A4, but that shouldn't (and actually doesn't) make any difference.
    This is as far as the properties button in the printer common dialog goes, I don't know if there's any "hidden" property that could be inspected elsewhere...

  4. #4
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    are you sure the printer drivers are exactly the same version on the two machines? It still shouldn't be doing what you're seeing, but that is something to look for.

  5. #5

  6. #6

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Baffled...

    OK guys, you're right, there ARE a few differences.

    The computer that is printing correctly:
    WinNT in English
    Driver version: 4.01

    The one that's printing y inverted:
    Win98 in Spanish
    Driver verision: 4.00

    Still, why would this happen at all? I don't know what to do... The end user should be able to run this app in any windows environment no matter the printer driver he/she has...
    Last edited by krtxmrtz; Jan 17th, 2003 at 03:22 AM.

  7. #7
    Hyperactive Member beasty1711's Avatar
    Join Date
    Mar 2001
    Posts
    418
    well i'd first try getting the driver version the same.. although it aint a real solution.. it will at least aid in the track down of whats going on
    "...They even have the internet on computers..." :- Homer Simpson

    "Second Place is First Looser" :- No Fear

  8. #8
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357
    There may be some locale setting difference as well, for example the "ThousandsSeparator" is different in English (",") and German ("."). There may be some other regional setting that affects the way your program is printing.

    Have you tried setting the locale on the Spanish machine to English and then running your program?
    Last edited by seaweed; Jan 17th, 2003 at 12:19 PM.
    ~seaweed

  9. #9

  10. #10

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573
    Interesting suggestion... I'll have a go at it as soon as I can get some other work done. Thanks for now.

  11. #11

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573
    (BUMP)
    The last post on this thread dates from January and at the time I had to finally lay the project aside as I could find no explanation.

    Now I'm tackling it afresh and have found this puzzling fact. I've run once again the code in my home pc and, whereas the compiled code performs as expected, the y-axis is still inverted when the code is run from the IDE. I suppose this rules out any cause related to regional settings. Still I'm clueless.

  12. #12

    Let me Try

    send me the code or what not, and I will test it on My printers running it across the network, and let me see if it prints correctly on my printers....

  13. #13

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573
    Attached is the backbone of my printing code. It reproduces the problem of inverting the Y axis on some printers. Also try to print with the code without and with compilation.

    What it does is printing the X and Y axes along with a few marks at specified coordinates. You may want to set the printing options to black and white.

    Regards.

    k
    Attached Files Attached Files

  14. #14
    Fanatic Member
    Join Date
    Sep 2002
    Location
    Lexington, SC
    Posts
    586
    What I'm confused here on is you say it prints "a few marks on the x and y axes". Every printer I've ever worked with in VB the X axis is the top border of the page and the y axis is the left boder of hte page. So 0, 0 is the top left corner of the page.

    Is there some setting or something somewhere that you changed to make it so 0,0 is the center of the page? Thats the only way I could figure you'd be getting a -y value and still be able to see it.

  15. #15

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573
    Originally posted by StevenHickerson
    Every printer I've ever worked with in VB the X axis is the top border of the page and the y axis is the left boder of hte page. So 0, 0 is the top left corner of the page.
    You're right, that's why I have defined my own coordinate system (take a look at the code):
    VB Code:
    1. Printer.ScaleMode = vbMillimeters
    2.     pw = Printer.ScaleWidth
    3.     ph = Printer.ScaleHeight
    4.     Printer.Scale (-pw / 2, ph / 2)-(pw / 2, -ph / 2)
    This sets the origin at the center of the page and, in principle, the x axis pointing to the right and the y axis pointing up. The problem is some printers do it as intended but others invert the y axis.

  16. #16
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Printer riddle [FAR FROM resolved]

    Originally posted by krtxmrtz
    the vertical coordinate y has been changed to -y.

    Then turn your printer upside-down.






    Sorry... couldn't resist.

  17. #17

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573
    How did the frog turn into Cameron? I'd like to do that too... kissing does not work

  18. #18
    Fanatic Member
    Join Date
    Sep 2002
    Location
    Lexington, SC
    Posts
    586
    Hrmmm, Ok so you scaled the printer in order to get this type of coordinate system. My next question then would be.. why in the heck would you want this lol? If its for printing things a certain way a few math equations could simulate this coordinate system with the normal system.

    And then you wouldn't have to worry about your y value being inverted on some printers =p

  19. #19

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573
    Originally posted by StevenHickerson
    Hrmmm, Ok so you scaled the printer in order to get this type of coordinate system. My next question then would be.. why in the heck would you want this lol? If its for printing things a certain way a few math equations could simulate this coordinate system with the normal system.
    I'm used to thinking in terms of a "normal" coordinate system as used in math and physics. After defining the printer scale it should work anyway. The funny thing is different printers interpret the scaling differently. Also why on earth the y axis is inverted after compilation?

  20. #20
    Fanatic Member
    Join Date
    Sep 2002
    Location
    Lexington, SC
    Posts
    586
    I dont know the answer to why it happens But I do know if you just use a function to return the coordinates into a regular printer coordinate you shouldn't have a problem.

    For example

    VB Code:
    1. Function XConCoord (X As Double) As Double
    2. XConCoord = (Printer.ScaleWidth / 2) + X
    3. End Function
    4. Function YConCoord (Y As Double) As Double
    5. YConCoord = (Printer.ScaleHeight / 2) + Y
    6. End Function

    You could then work with numbers as if you were working with the system your scaling to just pass the numbers through these functions and you will be converted over to a normal printer coordinate.

    Doing this you shouldnt have a problem with the Y being inverted. I can't reproduce the inverting on my 3 printers here at my house to figure out why your getting an inverted Y-Axis.

  21. #21

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573
    I may end up doing as you suggest but it's somewhat cumbersome having to transform every single coordinate, even if it amounts to just adding a number, especially when there's a lot of stuff to be printed. Moreover, the Printer.Scale method is supposed to be there precisely to avoid having to go through all that trouble.

  22. #22

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573
    bump

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width