Hi,
I'm trying to set the Paper Type (Media Type) whit the devSendData command. Here you find the VFP code I'm using for my tests.
cPT_col = "WdColoredPaper"
doprint(of.vpe, 4, cPT_col)
Function doPrint(vpe, nTray, cPaperType)
cPT = chr(27) + "&n"+alltrim(str(len(cPaperType)-1))+cPaperType
vpe.openDoc()
vpe.printoptions=16
vpe.device = "\\printserver\printer"
vpe.print(100,300,"Test Text Tray "+alltrim(str(nTray))+": "+ substr(cPT,1))
vpe.printDoc(.f.)
vpe.closeDoc()
endfunc
DEFINE CLASS PrintEngine AS ASE_VPE
FUNCTION DoPrintDevData(page, nResAct)
? "DoPrintDevData:" + " Page:"+ alltrim(str(page)) + " Action:"+ alltrim(str(nResAct))
? cPT
this.devSendData(cPT)
return (ASE_VPE::DoPrintDevData(page, nResAct))
ENDFUNC
FUNCTION PrintDoc(lWithSetup)
return (ASE_VPE::PrintDoc(lWithSetup))
ENDFUNC
FUNCTION RequestPrint(nAct,nResAct)
? "RequestPrint:" + " Act:"+ alltrim(str(nAct)) + " Action:"+ alltrim(str(nResAct))
ENDFUNC
ENDDEFINE
The Printer is setup to have the color paper in tray 4, but it takes the paper from tray 5.
Selecting the trays directly is no option. Setting the Paper Type in the Setup works, but I need to control it from the code.
Setting up several PRS files is also no option as the configuration changes often.
Any idea how the might work?
Thanks
Andreas
Thanks it is working now!