Available items in DevMode for Nemonic Driver

 

Offset

bytes

Type

Variable

Values

76

2

short

dmOrientation

1(Portrait) / 2(Landscape)

78

2

short

dmPaperSize

0(Custom) / 1 / 2 / 3 / 4 / 5

80

2

short

dmPaperLength

n(Flexible, unit is 0.1mm)

82

2

short

dmPaperWidth

800(Fixed, unit is 0.1mm)

86

2

short

dmCopies

n(Max is 100)

220

4

BOOL

bRotate180

true / false

224

4

BOOL

bDither

true / false

228

4

BOOL

bCutLastPage

true / false

Sample code to set values on DevMode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
            var printTicketConverter = new PrintTicketConverter(PrinterName, PrintTicketConverter.MaxPrintSchemaVersion);
            var devMode = printTicketConverter.ConvertPrintTicketToDevMode(_printQueue.UserPrintTicket, BaseDevModeType.UserDefault);
 
            if (actualWidth > actualHeight)
                // dmOrientation
                devMode[76= (byte)2;
 
            // dmPaperSize(for custom)
            devMode[78= (byte)0;
 
            // dmPaperLength
            var paperLength = (short)(Math.Round(72 * actualHeight / actualWidth) * 10 + 80);
            devMode[80= (byte)(paperLength & 0x00FF);
            devMode[81= (byte)((paperLength & 0xFF00>> 8);
 
            // dmPaperWidth (fixed value: 800)
            devMode[82= (byte)(800 & 0x00FF);
            devMode[83= (byte)((800 & 0xFF00>> 8);
 
            _printQueue.UserPrintTicket = printTicketConverter.ConvertDevModeToPrintTicket(devMode);
cs

DevMode all items

 

Offset

bytes

Type

Variable

0

64

WCHAR

dmDeviceName[CCHDEVICENAME]

64

2

WORD

dmSpecVersion

66

2

WORD

dmDriverVersion

68

2

WORD

dmSize

70

2

WORD

dmDriverExtra

72

4

DWORD

dmFields

76

2

short

dmOrientation

78

2

short

dmPaperSize

80

2

short

dmPaperLength

82

2

short

dmPaperWidth

84

2

short

dmScale

86

2

short

dmCopies

88

2

short

dmDefaultSource

90

2

short

dmPrintQuality

92

2

short

dmColor

94

2

short

dmDuplex

96

2

short

dmYResolution

98

2

short

dmTTOption

100

2

short

dmCollate

102

64

WCHAR

dmFormName[CCHFORMNAME]

166

2

WORD

dmLogPixels

168

4

DWORD

dmBitsPerPel

172

4

DWORD

dmPelsWidth

176

4

DWORD

dmPelsHeight

180

4

DWORD

dmNup

184

4

DWORD

dmDisplayFrequency

188

4

DWORD

dmICMMethod

192

4

DWORD

dmICMIntent

196

4

DWORD

dmMediaType

200

4

DWORD

dmDitherType

204

4

DWORD

dmReserved1

208

4

DWORD

dmReserved2

212

4

DWORD

dmPanningWidth

216

4

DWORD

dmPanningHeight

220

4

BOOL

bRotate180

224

4

BOOL

bDither

228

4

BOOL

bCutLastPage

 

카카오톡 채널 채팅하기 버튼