Add script to extract figure from page

This commit is contained in:
Thomas Dehaeze 2020-11-03 11:30:40 +01:00
parent f346509760
commit 987604a3a0

View File

@ -56,6 +56,7 @@
map <Space> scroll full-down map <Space> scroll full-down
map <BackSpace> scroll full-up map <BackSpace> scroll full-up
map <C-s> feedkeys ":exec /home/thomas/.config/zathura/scripts/extract-pdf-page.sh $FILE<Return>"
#+END_SRC #+END_SRC
* Colors * Colors
@ -96,3 +97,22 @@
set recolor "false" set recolor "false"
set recolor-keephue "false" set recolor-keephue "false"
#+end_src #+end_src
* Scripts
:PROPERTIES:
:header-args: :shebang "#!/usr/bin/env bash"
:header-args+: :comments both :mkdirp yes
:END:
** Extract one page as a PDF
#+begin_src bash :tangle ~/.config/zathura/scripts/extract-pdf-page.sh
tmpfile=/tmp/pdf_page.pdf
# Ask for page number
# Ideally would get the page from Zathura...
pagenum=$(rofi -dmenu -p "Page Number")
pdftk $1 cat $pagenum output $tmpfile.pdf && \
pdf2svg $tmpfile.pdf $tmpfile.svg && \
inkscape $tmpfile.svg
#+end_src