Skip to content

Commit

Permalink
ghostscript->gs
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlivio committed Apr 12, 2023
1 parent b1ce8b6 commit 37a4303
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ source "$BH_DIR/os_any.bash"
case $OSTYPE in
msys*)
source "$BH_DIR/os_win.bash"
alias ghostscript='gswin64.exe'
alias gs='gswin64.exe'
;;
linux*)
source "$BH_DIR/os_ubu.bash"
Expand All @@ -32,7 +32,7 @@ if type cmake &>/dev/null; then source "$BH_LIB/cmake.bash"; fi
if type docker &>/dev/null; then source "$BH_LIB/docker.bash"; fi
if type ffmpeg &>/dev/null; then source "$BH_LIB/ffmpeg.bash"; fi
if type flutter &>/dev/null; then source "$BH_LIB/flutter.bash"; fi
if type ghostscript &>/dev/null; then source "$BH_LIB/ghostscript.bash"; fi
if type gs &>/dev/null; then source "$BH_LIB/gs.bash"; fi
if type git &>/dev/null; then source "$BH_LIB/git.bash"; fi
if type latexmk &>/dev/null; then source "$BH_LIB/latex.bash"; fi
if type lxc &>/dev/null; then source "$BH_LIB/lxc.bash"; fi
Expand Down
29 changes: 0 additions & 29 deletions lib/ghostscript.bash

This file was deleted.

29 changes: 29 additions & 0 deletions lib/gs.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
function gs_compress() {
: ${1?"Usage: ${FUNCNAME[0]} <pdf>"}
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=${1%.*}-compressed.pdf $1
}

function gs_compress_hard1() {
: ${1?"Usage: ${FUNCNAME[0]} <pdf>"}
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -dPDFSETTINGS=//printer -dColorImageResolution=200 -sOutputFile=${1%.*}-compressed.pdf $1
}

function gs_compress_hard2() {
: ${1?"Usage: ${FUNCNAME[0]} <pdf>"}
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -dPDFSETTINGS=//ebook -sOutputFile=${1%.*}-compressed.pdf $1
}

function gs_concat() {
: ${2?"Usage: ${FUNCNAME[0]} <pdf_1> <pdf_2>"}
gs -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pdfwrite -sOUTPUTFILE=${1%.*}-${2%.*}-concat.pdf $1 $2
}

function gs_concat() {
: ${2?"Usage: ${FUNCNAME[0]} <pdf_1> <pdf_2>"}
gs -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pdfwrite -sOUTPUTFILE=${1%.*}-${2%.*}-concat.pdf $1 $2
}

function gs_remove_annotations() {
: ${1?"Usage: ${FUNCNAME[0]} <pdf>"}
gs -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pdfwrite -dShowAnnots=false -sOutputFile=${1%.*}-nocomments.pdf $1
}

0 comments on commit 37a4303

Please sign in to comment.