Created
May 23, 2021 13:35
-
-
Save olexs/5df9074495ca46209af95bd58a98c994 to your computer and use it in GitHub Desktop.
Convert a PDF to JPG image(s) optimized for quick transfer via fax (specifically Fritz!Box built-in fax)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
:top | |
if (%1) == () goto end | |
echo Extracting single page images from "%1"... | |
"imagemagick\convert.exe" -density 150 %1 "%~dpn1.fax.bmp" | |
for %%f in (.\*.fax*.bmp) do ( | |
echo Post-processing "%%~dpnf"... | |
"imagemagick\convert.exe" "%%f" -colorspace gray ^( +clone -blur 5,5 ^) -compose Divide_Src -composite -normalize -threshold 80%% "%%~dpnf.jpg" | |
del "%%f" | |
) | |
shift | |
goto top | |
:end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment