From de49aece2cc6f05ec37c210acf0bfcaf547161e4 Mon Sep 17 00:00:00 2001 From: Jake VanderVaate Date: Mon, 3 Jan 2022 17:02:47 -0600 Subject: removed PDF to image script --- README.md | 51 --------------------------------------------------- pdf2png.sh | 31 ------------------------------- 2 files changed, 82 deletions(-) delete mode 100755 pdf2png.sh diff --git a/README.md b/README.md index d45c491..db4b42a 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,6 @@ Templates I've designed for LaTeX documents -[TOC] - - ## Article ![Cover page of the article document](article/article-1.png) @@ -36,51 +33,3 @@ The resume is made up of the three following files: * **packages.tex**- This file contains all the packages I use in this template. The main resume file needs the commands.tex and packages.tex file in order to work, so you should copy the entire folder when you want to make another copy of this resume (this is a good idea with any LaTeX document). - - -## pdf2png.sh - -This shell script is what I used to generate the document screenshots for this README. -I included it for anyone who might be interested in doing the same. - -These are the dependencies for this script: - -* pdftoppm -* imagemagick -* optipng - -Follow these steps to use the script: - -1. Make the script executable with `chmod +x pdf2png.sh` -2. `cd` into the input PDF's directory -3. Use the command syntax `pdf2png.sh input.pdf first_page_to_convert last_page_to_convert` - -If you didn't add pdf2png.sh to your $PATH, make sure to include the path to the script in your command like `path/to/pdf2png.sh file.pdf 1 3` - -**Examples** - -Turn pages 1-3 from example.pdf into 3 separate PNG images - -`pdf2png.sh example.pdf 1 3` - - -Convert the first page of example.pdf into a PNG image - -`pdf2png.sh example.pdf 1 1` - -or - -`pdf2png.sh example.pdf` - - -Convert the third page of example.pdf into a PNG image - -`pdf2png.sh example.pdf 3 3` - -or - -`pdf2png.sh example.pdf 3` - - -I've only tested this script on Linux; I can't speak to how well it will work on Mac. -This script should work on Windows through Windows Subsystem for Linux (WSL), but I haven't tested that either. diff --git a/pdf2png.sh b/pdf2png.sh deleted file mode 100755 index 5628bdb..0000000 --- a/pdf2png.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -#strip the file name off the input PDF -input_pdf="$1" -file_name="$(find """$1""" | sed 's|\.pdf||g')" -first_page="$2" -last_page="$3" - -if [ "$2" = "" ] -then - first_page="1" -else - : -fi - -if [ "$3" = "" ] -then - last_page="$first_page" -else - : -fi -#convert the PDF to a 600px wide PNG image -pdftoppm -f "$first_page" -l "$last_page" -png -scale-to-x 696 -scale-to-y -1 "$input_pdf" "$file_name" - -#add a 2x2px border to the image.png file -for file in *.png; do - convert "$file" -bordercolor black -border 2x2 "$file" - - #compress the image - optipng "$file"; -done -- cgit v1.2.1