Autohotkey 自动热键,Foxit,PHP

Autohotkey 自动热键,Foxit,PHP,autohotkey,foxit-reader,Autohotkey,Foxit Reader,我正在尝试打印使用PHP和Mysql生成的相同PDF标签 PDF文件的创建已完成并正在运行。我将pdf保存在临时文件夹中。 然后我运行这个自动热键脚本: #Persistent SetTimer, PrintMon, 5000 ;every 5 seconds return PrintMon: IfExist C:\rolls\temp\*.pdf { runwait, "C:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit

我正在尝试打印使用PHP和Mysql生成的相同PDF标签

PDF文件的创建已完成并正在运行。我将pdf保存在临时文件夹中。 然后我运行这个自动热键脚本:

#Persistent 
SetTimer, PrintMon, 5000 ;every 5 seconds return
PrintMon:
IfExist C:\rolls\temp\*.pdf
  {
   runwait, "C:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe" /p "C:\rolls\temp\%A_LoopFileName%",,min 
}
FileDelete, C:\rolls\temp\*.pdf
Process, Close, foxitreader.exe
return
在生成和打印另一个PDF文件之前,我需要关闭Foxit程序

我试过“进程,关闭,foxitreader.exe” 和“Winclose,Start-Foxit阅读器”

但还是没有运气

希望有人能在这件事上帮我

谢谢

试试:

; Hard close
WinKill, Start - Foxit Reader

找到了一种保持工作的方法,即使foxit是开放的

在Foxit上转到文件->首选项->常规并禁用所有内容。 关于自动热键脚本更改

runwait, "C:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe" /p "C:\rolls\temp\%A_LoopFileName%",,min

并移除

Process, Close, foxitreader.exe
最终代码:

#Persistent
SetTimer, PrintMon, 5000 ;every 5 seconds return
PrintMon:
IfExist C:\rolls\temp\*.pdf
{
runwait, "C:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe" /p "C:\rolls\temp\%A_LoopFileName%",,hide
}
FileDelete, C:\rolls\temp\*.pdf
return
在这里,您可以使用AutoHotKey和Foxit Reader从PHP自动打印

更新: Foxit上的新版本存在无声打印问题。 现在使用版本6.23


除了ahkcoder的答案之外,您可能还想使用
WinWaitClose
heredid,但无论如何,问题出在最新版本的foxit上。
#Persistent
SetTimer, PrintMon, 5000 ;every 5 seconds return
PrintMon:
IfExist C:\rolls\temp\*.pdf
{
runwait, "C:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe" /p "C:\rolls\temp\%A_LoopFileName%",,hide
}
FileDelete, C:\rolls\temp\*.pdf
return