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 | |
if (( $# != 3 )); then | |
echo Usage: $0 in.pdf out.pdf '"x_bl,y_bl,x_tr,y_tr"' | |
exit 1 | |
fi | |
################################################## | |
## jq code to get minimal(?) json for qpdf to use | |
## to patch the cropboxes for every page object |
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 | |
if (( $# != 3 )); then | |
echo Usage: $0 in.pdf out.pdf '"x_bl,y_bl,x_tr,y_tr"' | |
exit 1 | |
fi | |
cmd='(..|objects|select(has("/MediaBox") or has("/CropBox")))' | |
cmd+='."/CropBox" = ['"$3"']' | |
tmp="$(tempfile)" |