From: Nicolas Boisselier Date: Sun, 16 Apr 2023 22:06:46 +0000 (+0200) Subject: Add pdf2txt X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=8eea17a0f048721f99a664fd8f7a546df6802f81;p=nb.git Add pdf2txt --- diff --git a/etc/profile.d/functions b/etc/profile.d/functions index 7f3dbc9b..8edabb41 100755 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -891,3 +891,12 @@ cron_d_install() { [ "$cron" != "$(crontab -l)" ] && echo "$cron" | crontab } + +# NB 17.04.23: Convert a list a file into text and print them to stdout +pdf2txt() { + local IFS=$'\n' + declare file + for file in $@; do + pdftotext -layout "$file" - + done +}