summaryrefslogtreecommitdiff
path: root/pdf2png.sh
diff options
context:
space:
mode:
authorJake VanderVaate <jake.vandervaate@protonmail.com>2021-09-21 17:57:34 -0500
committerJake VanderVaate <jake.vandervaate@protonmail.com>2021-09-21 17:57:34 -0500
commit142705f3bc31c5b618419be80a3af40effbb6429 (patch)
treefdba0334eba65697e750eadc6518498677c3e2d9 /pdf2png.sh
parentb9532e2dd4fad755c9ecdf2f953d2eafc4b4bf63 (diff)
added resume template and screenshot shell script
Diffstat (limited to 'pdf2png.sh')
-rwxr-xr-xpdf2png.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/pdf2png.sh b/pdf2png.sh
new file mode 100755
index 0000000..37c30b8
--- /dev/null
+++ b/pdf2png.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#strip the file name off the input PDF
+file="$(ls ""$1"" | sed 's|\.pdf||g')"
+
+#convert the PDF to a 600px wide PNG image
+pdftoppm -singlefile -png -scale-to-x 696 -scale-to-y -1 "$1" "$file"
+
+#add a 2x2px border to the image.png file
+convert "$file".png -bordercolor black -border 2x2 "$file".png
+
+#compress the image
+optipng "$file".png