CompuServe Messages

#Printer Positioning

    13-Oct-91 20:10:51
Fm: Keith Funk/Vanc.BC,CAN. 72240,2020
To: Bryon Scott 76326,1070
Hi Bryon, I think the problem you are having is that Printer.Width returns the actual width of the paper in your printer without taking into account the unprintable boarder that Win3 imposes. On my dotmatrix printer, Printer.Width tells me that the paper is 12,240 twips wide (8.5 inches) which is correct. But the API GetDeviceCaps function tells me that the paper is only 203mm wide (8 inches) which is in fact the *printable* width. Win3 will just not print more than 8 inches wide on my printer. You are only getting 'Pa' printed on the right of your header because Win3 is truncating the text because it has reached the edge of the printable area as far as Win3 is concerned. Rather than using Printer.Width, try this. Declare GetDeviceCaps as follows: Declare Function GetDeviceCaps Lib "GDI" (ByVal hDC As Integer, ByVal nIndex As Integer) As Integer Compute the printable width in twips as follows. PWidth# = 1440# * GetDeviceCaps(Printer.hDC, 4) / 25.4 Use PWidth# in your computations rather than Printer.Width. Hope this helps. KeithF There are 2 Replies.