From 8eea17a0f048721f99a664fd8f7a546df6802f81 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 17 Apr 2023 00:06:46 +0200 Subject: [PATCH] Add pdf2txt --- etc/profile.d/functions | 9 +++++++++ 1 file changed, 9 insertions(+) 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 +} -- 2.47.3