Last active
January 17, 2021 17:46
-
-
Save diegoquintanav/97b2584ccd973527db7d5d27c93c42b4 to your computer and use it in GitHub Desktop.
shrink slides or pdfs to nxm sheets per page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# converts to pdf all txt files in a folder | |
# and produces a single pdf of all of them together | |
for filename in $(ls *.txt); do | |
libreoffice --convert-to "pdf" "$filename" | |
done | |
# join all of them in a single pdf | |
pdftk $(ls *.pdf) cat output output_all.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# prepends the filename to all txt files in a folder: | |
for filename in $(ls *.txt); do | |
sed -i.bak "1s;^;${filename}\n;" "$filename" | |
done | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# converts a set of slides to a 3x2 set of slides | |
# see https://tex.stackexchange.com/questions/557580/pdfjam-or-equivalent-custom-layout-for-multiple-pages-per-sheet | |
INPUT="$1" | |
NUP="$2" | |
pdfnup --suffix "$NUP" --frame True --nup $NUP $INPUT | |
# usage ./shrink-nxm file.pdf 2x1 | |
# produces a file-2x1.pdf in the same folder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment