如何按打印机名称部件将PDF文件打印到打印机
如何从桌面应用程序将pdf文件打印到Windows 10中名称包含“labelprinter”的打印机 我在VisualFoxPro中尝试了下面的代码,但它会打印到windows默认打印机。 可以使用某些bat文件按名称设置pritner如何按打印机名称部件将PDF文件打印到打印机,pdf,printing,visual-foxpro,windows-scripting,Pdf,Printing,Visual Foxpro,Windows Scripting,如何从桌面应用程序将pdf文件打印到Windows 10中名称包含“labelprinter”的打印机 我在VisualFoxPro中尝试了下面的代码,但它会打印到windows默认打印机。 可以使用某些bat文件按名称设置pritner * cPDFFile - name of PDF file to print nprinter = aprinters(aprinterid) for i=1 to nPrinters if 'labelprinter'$lowe( aprinteri
* cPDFFile - name of PDF file to print
nprinter = aprinters(aprinterid)
for i=1 to nPrinters
if 'labelprinter'$lowe( aprinterid[i,1] )
DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin
set printer to name (aprinterid[i,1])
ShellExecute(0, "print", cPDFFile , "", "", 1)
exit
endif
endfor
您可以使用“printto”动词指定打印机名称:
ShellExecute(0, "printto", cPDFFile , "printername", "", 1)
非常感谢。很好的解决方案。我在搜索过程中没有找到这个。我只需要提示使用api调用更改windows默认打印机