Page 1 of 1

LineXY on printer - single lines toooooooooooo fat

Posted: Tue Feb 09, 2010 3:20 pm
by lnxque
Try this example under Linux and Windows. You will get different results.

Code: Select all

If DefaultPrinter()
   If StartPrinting("printtest")
      If StartDrawing(PrinterOutput())
         FrontColor(0)
         BackColor(RGB($ff,$ff,$ff))
         y.f=10
         For i.w=1 To 3
             DrawText(10,y,"This is a printingtest!")
             LineXY(10,y+1.5,TextWidth("This is a printingtest!")+10,y+1.5)
             y+15
         Next
         StopDrawing()
      EndIf
      StopPrinting()
   EndIf
EndIf

End
My major question. how to draw small lines (0.1mm)? Is there a command like "SetLineSize(pixel)" available?

Re: LineXY on printer - single lines toooooooooooo fat

Posted: Tue Feb 09, 2010 6:27 pm
by Trond
Maybe the dpi setting is different?

Re: LineXY on printer - single lines toooooooooooo fat

Posted: Wed Feb 10, 2010 2:13 pm
by lnxque
No dpi issue. tested on 2 printers, always the same (Windows OK, Linux not). using DefaultPrinter() should be use default settings...?

How could i set up the dpi resolution via code (if really necessary)?

Re: LineXY on printer - single lines toooooooooooo fat

Posted: Wed Feb 10, 2010 2:32 pm
by Trond
How can you say no dpi issue when you don't know how to set the dpi??? I think it must be set with PrintRequester().

Try debugging PrinterPageHeight() to see how many pixels go on the page on Windows and Linux.

Also, don't pass a float to LineXY(), it takes integers.

Re: LineXY on printer - single lines toooooooooooo fat

Posted: Thu Feb 11, 2010 10:38 am
by lnxque
Yes, you are right, there are two different values. tested on a pos-printer. very strange and unexpected.

Windows: W:512, H:2104
Linux: W:204, H:842

The drivers in all OS configured to: width 80mm, height 297mm, resolution 180dpi

How can it happen, that i "loose" ~100dpi? printing a testpage via driversettings works well.