Skip to content

Instantly share code, notes, and snippets.

@igneus
Last active January 6, 2019 18:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save igneus/aa91d47ad343e902fb86a4988ad50a8d to your computer and use it in GitHub Desktop.
Kolik normostran textu obsahuje daný pdf dokument?
#!/bin/bash
# Klasicka otazka studentova: Kolik normostran ma me pdf?
if [ $# -lt 1 ]
then
echo "pdf file expected as command line argument."
exit 1
fi
chars_per_page=1800
chars=$(pdftotext $1 - | wc -m)
echo $chars
ruby -e "puts '%.2f' % ($chars.to_f / $chars_per_page)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment