20200703 1521

 

00 자료

"https://www.autohotkey.com/boards/viewtopic.php?t=13544

"https://www.autohotkey.com/boards/viewtopic.php?f=6&t=5538"

 

01 유틸받기;

"http://zbar.sourceforge.net/"

 

02 코드

#Warn,UseUnsetLocal
#NoEnv
#SingleInstance Force
SetBatchLines,-1

ZBarFilePath:="c:\ZBar V0.10\zbarimg.exe"
ZBarFilePath:="C:\Program Files (x86)\ZBar\bin\zbarimg.exe"
ZBarFilePath:=A_WorkingDir "\bin\zbarimg.exe"
MsgBox,% ZBarFilePath
If (!FileExist(ZBarFilePath))
{
  MsgBox,4112,Fatal Error,ZBar executable does not exist
  ExitApp
}


InputFile:="c:\Temp\zBarcode Test In.png"
If (!FileExist(InputFile))
{
  MsgBox,4112,Fatal Error,Input file does not exist
  ExitApp
}

OutputFile:="c:\Temp\Barcode Test Out.txt"
FileDelete,%OutputFile%
BeginRecognitionTime:=A_TickCount

;RunWait,%comspec% /c ""%ZBarFilePath%" "%InputFile%">"%OutputFile%"",,Hide
RunWait,%comspec% /c ""%ZBarFilePath%" "%InputFile%">"%OutputFile%"",,Hide
EndRecognitionTime:=A_TickCount
RecognitionTime:=EndRecognitionTime-BeginRecognitionTime
FileGetSize,OutputFileSize,%OutputFile%
If (OutputFileSize=0)
{
  MsgBox,4144,Warning Error,Output file size is 0`nWill delete it
  FileDelete,%OutputFile%
}
Else
{
  FileAppend,Recognition Time=%RecognitionTime%ms,%OutputFile%
  Run,%OutputFile%
}
ExitApp

(note) png파일은 잘 읽히고, pdf도 된다는데 잘 안된다.

Posted by Weneedu
,


출처: https://privatedevelopnote.tistory.com/81 [개인노트]