Skip to content

Instantly share code, notes, and snippets.

@wyfinger
Created October 20, 2017 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wyfinger/7b210ff069a605c24fb7774f347006d3 to your computer and use it in GitHub Desktop.
Save wyfinger/7b210ff069a605c24fb7774f347006d3 to your computer and use it in GitHub Desktop.
Mass check pdf files for Text layer by pdftotext.exe from Poppler
@ECHO OFF
SET filelist=pdflist.txt
SET textfile=c:\PDF\text.txt
SET outfile=pdfcheck.txt
rem delete results log
del /Q %outfile%
rem check files to text layer in loop
FOR /F "tokens=* usebackq" %%I IN ("%filelist%") DO (
if exist %textfile% (
del /Q %textfile%
)
rem pause
pdftotext -q "%%I" %textfile%
rem pause
FOR /F "usebackq" %%A IN ('%textfile%') DO (
rem echo %%~zA
rem pause
if %%~zA GTR 50 (
echo TEXT EXISTS [%%~zA] %%I
) else (
echo TEXT NOT EXISTS [%%~zA] %%I
echo %%I >> %outfile%
)
rem pause
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment