@@ -52,6 +52,7 @@ import Data.Char ( toLower, toUpper )
5252import Data.List ( delete, intercalate, isPrefixOf, isSuffixOf, sort )
5353import System.Directory ( getAppUserDataDirectory, findExecutable,
5454 doesFileExist, Permissions(..), getPermissions )
55+import System.Process ( readProcessWithExitCode )
5556import System.IO ( stdout, stderr )
5657import System.IO.Error ( isDoesNotExistError )
5758import qualified Control.Exception as E
@@ -1401,8 +1402,8 @@ convertWithOpts opts args = do
14011402 _ | html5Output -> "wkhtmltopdf"
14021403 _ -> latexEngine
14031404 -- check for pdf creating program
1404− mbPdfProg <- findExecutable pdfprog
1405− when (isNothing mbPdfProg) $
1405+ (ec,_,_) <- readProcessWithExitCode pdfprog ["--version"] ""
1406+ when (ec /= ExitSuccess) $
14061407 err 41 $ pdfprog ++ " not found. " ++
14071408 pdfprog ++ " is needed for pdf output."
14081409