GOTO %1
GOTO :eof


:askInterface
		CLS
		@ECHO OFF
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO User Interface Level:
		ECHO   1^) Simple                                 (quick ^& easy^)
		ECHO   2^) Normal                                 (recommended^)
		ECHO   3^) Advanced                               (the most explanations and options^)
		ECHO.
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                    (Type q then RETURN to quit^)
GOTO :eof

:promptInterface
		SET /P UI=[%UI%]: 
GOTO :eof



:askInputFile
	CLS
	@ECHO OFF
	ECHO.
	ECHO.
	ECHO   !! Please use the dialog box to select an input file !!
	ECHO.
	ECHO.
	ECHO.
	ECHO.
	ECHO NOTE: from the command line, you may also use 
	ECHO PDFrasterFarian.exe  "inputPath"  "outputPath"  option-string  "title"  "author"
	ECHO Use the One-Click Profiles Manager to generate a valid option-string
	
		"%relpath%/modules/AskOpenPath.exe" "%relpath%/temp/inputPath.txt"
		SET /P inputFile=<"%relpath%/temp/inputPath.txt"
GOTO :eof





:askOutputFile
	CLS
	@ECHO OFF
	ECHO.
	ECHO    Please use the dialog box to select an output file
	ECHO.
	
		"%relpath%/modules/AskSavePath.exe" "%relpath%/temp/outputPath.txt"
		SET /P outputFile=<"%relpath%/temp/outputPath.txt"
GOTO :eof


:warn2OutputFile
	ECHO.
	ECHO.
	ECHO !!!!ERROR: Output file cannot be written to!
	ECHO.
	ECHO %outputFile%
	ECHO.
	ECHO.
	ECHO Possible causes include:
	ECHO   +invalid filename
	ECHO   +the file is already open
	ECHO   +insufficient file system permissions
	ECHO.
	ECHO. 
	pause
GOTO :eof





:askPriority
       IF "%UI%"=="3" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO In Windows, each process is assigned a priority (most processes are 'normal'^)
		ECHO.
		ECHO This setting lets you control whether PDFrasterFarian
		ECHO   receives greater priority for requisitioning CPU power
		ECHO.
		ECHO.
		ECHO A setting of 'BelowNormal' will leave your computer very responsive
		ECHO.
		ECHO WARNING: Using 'AboveNormal' will temporarily turn your computer into molasses
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO Processing priority for running the kernels:
		ECHO   1^) AboveNormal                 (not recommended^)
		ECHO   2^) Normal                      (faster if CPU is already being heavily used^)
		ECHO   3^) BelowNormal                 (recommended^)
		ECHO.
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
) ELSE IF "%UI%"=="2" (
		REM
) ELSE IF "%UI%"=="1" (
		REM
)
GOTO :eof

:promptPriority
       IF "%UI%"=="3" (
		SET /P priority=[%priority%]: 
) ELSE IF "%UI%"=="2" (
		IF "%priority%"=="b" SET priority=3
) ELSE IF "%UI%"=="1" (
		IF "%priority%"=="b" SET priority=3
)
GOTO :eof



:askAutocrop
       IF "%UI%"=="3" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO Autocropping eliminates unnecessary blank margins, enlarging the text
		ECHO.
		ECHO However, manual cropping with, eg, Acrobat Pro is recommended since
		ECHO   it permits removing visible things such as page numbers.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO Autocrop the file?
		ECHO   y^) Yes
		ECHO   n^) No
		ECHO.
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
) ELSE IF "%UI%"=="2" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO Autocropping eliminates unnecessary blank margins, enlarging the text
		ECHO.
		ECHO However, manual cropping with, eg, Acrobat Pro is recommended since
		ECHO   it permits removing visible things such as page numbers.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO Autocrop the file?
		ECHO   y^) Yes
		ECHO   n^) No
		ECHO.
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                    (Type q then RETURN to quit^)
) ELSE IF "%UI%"=="1" (
		REM
)
GOTO :eof

:promptAutocrop
       IF "%UI%"=="3" (
		SET /P autocrop=[%autocrop%]: 
) ELSE IF "%UI%"=="2" (
		SET /P autocrop=[%autocrop%]: 
) ELSE IF "%UI%"=="1" (
		REM
)
GOTO :eof



:askOrientation
       IF "%UI%"=="3" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO You have the option of showing whole pages on the Reader's screen
		ECHO     or splitting each page into two or four parts.
		ECHO.
		ECHO.
		ECHO Halfs layout uses the Reader's landscape mode.
		ECHO     To enable the Reader's landscape mode, hold the Size button for 5 seconds.
		ECHO     Page count is not affected
		ECHO.
		ECHO Quarters layout uses the Reader's portrait mode (as does the whole-page layout^)
		ECHO     Page count increases 4x
		ECHO     You have the option of deciding the overlaps with this layout
		ECHO.
		ECHO.
		ECHO.
		ECHO Arrange as:
		ECHO   1^) whole pages per screen                  
		ECHO   2^) split into halfs                (use the Reader's landscape mode^)
		ECHO   3^) split into quarters             (for multi-column documents only^)
		ECHO.
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
) ELSE IF "%UI%"=="2" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO You have the option of showing whole pages on the Reader's screen
		ECHO     or splitting each page into two or four parts.
		ECHO.
		ECHO.
		ECHO Halfs layout uses the Reader's landscape mode.
		ECHO     To enable the Reader's landscape mode, hold the Size button for 5 seconds.
		ECHO     Page count is not affected
		ECHO.
		ECHO Quarters layout uses the Reader's portrait mode (as does the whole-page layout^)
		ECHO     Page count increases 4x
		ECHO     You have the option of deciding the overlaps with this layout
		ECHO.
		ECHO.
		ECHO.
		ECHO Arrange as:
		ECHO   1^) whole pages per screen                          
		ECHO   2^) split into halfs                (use the Reader's landscape mode^)
		ECHO   3^) split into quarters             (for multi-column documents only^)
		ECHO.
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
) ELSE IF "%UI%"=="1" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO You have the option of showing whole pages on the Reader's screen
		ECHO     or splitting each page into two parts.
		ECHO.
		ECHO.
		ECHO Halfs layout uses the Reader's landscape mode.
		ECHO     To enable the Reader's landscape mode, hold the Size button for 5 seconds.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO Arrange as:
		ECHO   1^) whole pages per screen                         
		ECHO   2^) split into halfs                (use the Reader's landscape mode^)
		ECHO.
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                    (Type q then RETURN to quit^)
)
GOTO :eof
		
:promptOrientation
       IF "%UI%"=="3" (
		SET /P orientation=[%orientation%]: 
) ELSE IF "%UI%"=="2" (
		SET /P orientation=[%orientation%]: 
) ELSE IF "%UI%"=="1" (
		SET /P orientation=[%orientation%]: 
)
GOTO :eof




:askOverlap
       IF "%UI%"=="3" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO For two-column documents, 0%% horizontal overlap may work well
		ECHO For three-column documents, as much as 33%% horizontal overlap may be needed
		ECHO.
		ECHO Vertical overlap matters less, but having 10%% is usually ergonomic
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO Enter a horizontal overlap ^(in percent^)
		ECHO.
		ECHO.
		ECHO                                               ^(press RETURN for default option^)
) ELSE IF "%UI%"=="2" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO For two-column documents, 0%% horizontal overlap may work well
		ECHO For three-column documents, as much as 33%% horizontal overlap may be needed
		ECHO.
		ECHO Vertical overlap matters less, but having 10%% is usually ergonomic
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO Enter a horizontal overlap ^(in percent^)
		ECHO.
		ECHO.
		ECHO                                               ^(press RETURN for default option^)
) ELSE IF "%UI%"=="1" (
		REM
)
GOTO :eof

:promptHOverlap
       IF "%UI%"=="3" (
		SET /P hOverlap=[%hOverlap%]: 
) ELSE IF "%UI%"=="2" (
		SET /P hOverlap=[%hOverlap%]: 
) ELSE IF "%UI%"=="1" (
		REM
)
GOTO :eof

:promptVOverlap
       IF "%UI%"=="3" (
		SET /P vOverlap=[%vOverlap%]: 
) ELSE IF "%UI%"=="2" (
		SET /P vOverlap=[%vOverlap%]: 
) ELSE IF "%UI%"=="1" (
		REM
)
GOTO :eof





:askProcessing
       IF "%UI%"=="3" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO The full-blown post-processing does a good job increasing boldness and contrast
		ECHO       However, this mode can be slow (especially with higher post-proc values^)
		ECHO.
		ECHO The simple post-processing increases contrast only
		ECHO       Letters turn out sharper, but less "natural" and less bold
		ECHO.
		ECHO Choose 'none' for no post-processing (rasterize only^)
		ECHO       Sometimes useful (perhaps with image-based PDFs^)
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO Level of post-processing:
		ECHO   1^) full                   (slower. Best quality.^)
		ECHO   2^) simple                 (faster^)
		ECHO   3^) none
		ECHO.
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
) ELSE IF "%UI%"=="2" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO The full-blown post-processing does a good job increasing boldness and contrast
		ECHO       However, this mode can be slow (especially with higher post-proc values^)
		ECHO.
		ECHO The simple post-processing increases contrast only
		ECHO       Letters turn out sharper, but less "natural" and less bold
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO Level of post-processing:
		ECHO   1^) full                   (slower. Best quality.^)
		ECHO   2^) simple                 (faster^)
		ECHO.
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
) ELSE IF "%UI%"=="1" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO The full-blown post-processing does a good job increasing boldness and contrast
		ECHO       However, this mode can be slow
		ECHO.
		ECHO The simple post-processing increases contrast only
		ECHO       Letters turn out sharper, but less "natural" and less bold
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO Level of post-processing:
		ECHO   1^) full                   (slower. Best quality.^)
		ECHO   2^) simple                 (faster^)
		ECHO.
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Type b then RETURN to go back^)
		ECHO                                                    (Type q then RETURN to quit^)
		)
GOTO :eof

:promptProcessing
       IF "%UI%"=="3" (
		SET /P processing=[%processing%]: 
) ELSE IF "%UI%"=="2" (
		SET /P processing=[%processing%]: 
) ELSE IF "%UI%"=="1" (
		SET /P processing=[%processing%]: 
)
GOTO :eof





:askResMultiplier
       IF "%UI%"=="3" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO You can adjust the image enhancement. Higher values mean less boldness
		ECHO.
		ECHO     NOTE: Paradoxically, compute time rises as O(boldness-value^2)
		ECHO     NOTE: Higher values take geometrically more RAM as well
		ECHO     NOTE: Running 4 threads at once at a boldness of 20 can use 732MB of memory
		ECHO            On ordinary settings (2 threads, 8 boldness^), up to 52MB are used
		ECHO            To reduce memory use, users of old machines can
		ECHO                                        use lower (heavier^) boldness values
		ECHO                                        use 'simple' processing
		ECHO                                        or decrease thread count (install.cmd^)
		ECHO            Users with 1GB or more of ram need to shut up
		ECHO.
		ECHO.
		ECHO.
		ECHO Level of boldness:
		ECHO   3^) heavy                             (for large-size text, esp in landscape^)
		ECHO   6^) medium
		ECHO  12^) light
		ECHO   x^) You may enter any integer value 2-20
		ECHO.
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
) ELSE IF "%UI%"=="2" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO You can adjust the image enhancement. Higher values mean less boldness
		ECHO.
		ECHO     NOTE: Higher values quickly take much longer to calculate
		ECHO     NOTE: Higher values take geometrically more RAM as well
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO Level of boldness:
		ECHO   3^) heavy                              (for large-size text, esp in landscape^)
		ECHO   6^) medium
		ECHO  12^) light
		ECHO   x^) You may enter any integer value 2-20
		ECHO.
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
) ELSE IF "%UI%"=="1" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO.
		ECHO You can adjust the image enhancement. Higher values mean less boldness
		ECHO.
		ECHO     NOTE: Higher values rapidly take much more resources
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO.
		ECHO Level of boldness:
		ECHO   3^) heavy                              (for large-size text, esp in landscape^)
		ECHO   6^) medium
		ECHO  12^) light
		ECHO   x^) You may enter any integer value 2-20
		ECHO.
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Type b then RETURN to go back^)
		ECHO                                                    (Type q then RETURN to quit^)
)
GOTO :eof

:promptResMultiplier
       IF "%UI%"=="3" (
		SET /P resMultiplier=[%resMultiplier%]: 
) ELSE IF "%UI%"=="2" (
		SET /P resMultiplier=[%resMultiplier%]: 
) ELSE IF "%UI%"=="1" (
		SET /P resMultiplier=[%resMultiplier%]: 
)
GOTO :eof




:askPreview
       IF "%UI%"=="3" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO Enter a page to preview
		ECHO   x^) Any page from 1 to %numPages%
		ECHO   s^) Skip                                     (go straight to converting^)
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
) ELSE IF "%UI%"=="2" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO Enter a page to preview
		ECHO   x^) Any page from 1 to %numPages%
		ECHO   s^) Skip                                     (go straight to converting^)
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
) ELSE IF "%UI%"=="1" (
		CLS
		@ECHO OFF
		ECHO.
		ECHO Enter a page to preview
		ECHO   x^) Any page from 1 to %numPages%
		ECHO   s^) Skip                                     (go straight to converting^)
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
)
GOTO :eof

:promptPreview
       IF "%UI%"=="3" (
		SET /P page=[%page%]: 
) ELSE IF "%UI%"=="2" (
		SET /P page=[%page%]: 
) ELSE IF "%UI%"=="1" (
		SET /P page=[%page%]: 
)
GOTO :eof




:askContinue
       IF "%UI%"=="3" (
		ECHO     Note: This image will look MUCH different on an eInk screen.
		ECHO                Typically, it will look smoother and less bold.
		ECHO.
		ECHO Are you satisfied with the result?
		ECHO   y^) yes
		ECHO   b^) go back             (return to conversion options^)
		ECHO   p^) preview                  (to preview another page^)
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
) ELSE IF "%UI%"=="2" (
		ECHO     Note: This image will look MUCH different on an eInk screen.
		ECHO                Typically, it will look smoother and less bold.
		ECHO.
		ECHO.
		ECHO Are you satisfied with the result?
		ECHO   y^) yes
		ECHO   b^) go back             (return to conversion options^)
		ECHO   p^) preview                  (to preview another page^)
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
) ELSE IF "%UI%"=="1" (
		ECHO     Note: This image will look MUCH different on an eInk screen.
		ECHO                Typically, it will look smoother and less bold.
		ECHO.
		ECHO.
		ECHO Are you satisfied with the result?
		ECHO   y^) yes
		ECHO   b^) go back             (return to conversion options^)
		ECHO   p^) preview                  (to preview another page^)
		ECHO.
		ECHO                                               (press RETURN for default option^)
		ECHO                                                 (Enter b to go back, q to quit^)
)
GOTO :eof

:promptContinue
       IF "%UI%"=="3" (
		SET /P continue=[%continue%]: 
) ELSE IF "%UI%"=="2" (
		SET /P continue=[%continue%]: 
) ELSE IF "%UI%"=="1" (
		SET /P continue=[%continue%]: 
)
GOTO :eof

