Dear all,
I have noticed that trying to OCR some of my PDF files causes a crash. But if I open the file with (and only!) SumatraPDF I can print the pdf to a pdf file (with bullzip) and get a new pdf file that I can then OCR successfully.
So I need to print pdf-to-pdf many pdf files gathered inside one big folders and its many sub-folders.
I thought that an .ahk script would help me : I choose the folder where I have the original pdf files. It opens SumatraPDF silently, it logs the possible files in error then continue, and print to the default free printer Bullzip silently.
I have already chosen the default output folder and the silent part in the settings of Bullzip.
I have tried to adapt an old ahk file to my purpose, but it doesn't work. ;(
Many thanks in advance
ps: I also use these freeware a lot which helps reduce the list of pdf files which have problems with OCR : PDF Text Checker https://www.donationcoder.com/forum/index.php?topic=27311.0, PDFInfoGUI http://skwire.dcmembers.com/fp/?page=pdfinfogui both from skwire and this command line script WINDOWS+R : https://www.donationcoder.com/forum/index.php?topic=35339.msg330784#msg330784
I have noticed that trying to OCR some of my PDF files causes a crash. But if I open the file with (and only!) SumatraPDF I can print the pdf to a pdf file (with bullzip) and get a new pdf file that I can then OCR successfully.

So I need to print pdf-to-pdf many pdf files gathered inside one big folders and its many sub-folders.
I thought that an .ahk script would help me : I choose the folder where I have the original pdf files. It opens SumatraPDF silently, it logs the possible files in error then continue, and print to the default free printer Bullzip silently.
I have already chosen the default output folder and the silent part in the settings of Bullzip.
I have tried to adapt an old ahk file to my purpose, but it doesn't work. ;(
Code
FileSelectFolder,SourcePath,,0,Select Source Folder
If SourcePath =
ExitApp
Loop,%SourcePath%\*.*,2,0
{
FolderSize = 0
Loop, %A_LoopFileFullPath%\*.*, , 1
FolderSize += %A_LoopFileSize%
If FolderSize >0
RunWait,C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe -print-to-default -silent "%A_LoopFileFullPath%\*.*"
}Many thanks in advance

ps: I also use these freeware a lot which helps reduce the list of pdf files which have problems with OCR : PDF Text Checker https://www.donationcoder.com/forum/index.php?topic=27311.0, PDFInfoGUI http://skwire.dcmembers.com/fp/?page=pdfinfogui both from skwire and this command line script WINDOWS+R : https://www.donationcoder.com/forum/index.php?topic=35339.msg330784#msg330784










