Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printer original paper size
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00751188
Message ID:
00751244
Vues:
17
Try the code below (substitute 'Epson Stylus...' with your printer's name). It will return something like:
Letter
Legal
Statement
Executive
A4
...

#DEFINE DC_PAPERS 2
#DEFINE DC_SIZE 8
#DEFINE DC_VERSION 10
#DEFINE DC_PAPERNAMES 16

DECLARE INTEGER DeviceCapabilities IN winspool.drv;
STRING pDevice, STRING pPort, INTEGER fwCapability,;
STRING @pOutput, INTEGER pDevMode

LOCAL lcBuffer, lnCount, lnIndex, lcName
lcBuffer = Repli(Chr(0), 16384)

lnCount = DeviceCapabilities("Epson Stylus COLOR 660 ESC/P 2", "LPT1",;
DC_PAPERNAMES, @lcBuffer, 0)

FOR lnIndex=1 To lnCount
lcName = SUBSTR(lcBuffer, (lnIndex-1)*64+1, 64) + Chr(0)
lcName = SUBSTR(lcName, 1, AT(Chr(0), lcName)-1)
? lcName
ENDFOR
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform