Created
January 13, 2022 08:38
-
-
Save niw/203719671946a74cc23dbfe33836b6d2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
# Download ghostpdl source code from <https://github.com/ArtifexSoftware/ghostpdl-downloads/releases>, | |
# expand an archive, and configure then make. | |
# Following `BIN_PATH` may need to change for the given version and path. | |
set -euo pipefail | |
readonly CURRENT_PATH=$(cd "$(dirname "$BASH_SOURCE[0]")" >/dev/null; pwd) | |
readonly BIN_PATH=$CURRENT_PATH/ghostpdl-9.55.0/bin | |
if (( $# < 1 )); then | |
echo "Usage: $0 xpsfile" | |
exit 1 | |
fi | |
readonly INPUT_FILE="$1" | |
readonly OUTPUT_FILE="${1%.xps}.pdf" | |
exec $BIN_PATH/gxps \ | |
-sDEVICE=pdfwrite \ | |
-sOutputFile="$OUTPUT_FILE" \ | |
-dNOPAUSE \ | |
"$INPUT_FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment