Hallo,
this is a very simple code with which is possible to create the important functions PrinterPageHorDPI() e PrinterPageVerDPI() to know the DPI resolution of a printer.
Code: Select all
If PrintRequester()
printer_DC.l = StartDrawing(PrinterOutput())
If printer_DC
Debug "Horizontal DPI = " + Str(GetDeviceCaps_(printer_DC,#LOGPIXELSX))
Debug "Vertical DPI = " + Str(GetDeviceCaps_(printer_DC,#LOGPIXELSY))
Debug "Physical Width in pixels = " + Str(GetDeviceCaps_(printer_DC,#PHYSICALWIDTH))
Debug "Physical Height in pixels = " + Str(GetDeviceCaps_(printer_DC,#PHYSICALHEIGHT))
Debug "Horizontal margin in pixels = " + Str(GetDeviceCaps_(printer_DC,#PHYSICALOFFSETX))
Debug "Vertical margin in pixels = " + Str(GetDeviceCaps_(printer_DC,#PHYSICALOFFSETY))
Debug "Width in pixels (same as PrinterPageWidth())= " + Str(GetDeviceCaps_(printer_DC,#HORZRES))
Debug "Height in pixels (same as PrinterPageHeight())= " + Str(GetDeviceCaps_(printer_DC,#VERTRES))
Debug "PriterPageWidth() = " + Str(PrinterPageWidth())
Debug "PrinterPageHeight() = " + Str(PrinterPageHeight())
Debug "Width in millimiter (same as Width in pixels * 25.4 / DPI) = " + Str(GetDeviceCaps_(printer_DC,#HORZSIZE))
Debug "Height in millimiter (same as Height in pixels * 25.4 / DPI)= " + Str(GetDeviceCaps_(printer_DC,#VERTSIZE))
EndIf
StopDrawing()
EndIf
End
---------------
Alberto