Skip to content

Instantly share code, notes, and snippets.

@tonio-m
Created October 26, 2020 01:09
Show Gist options
  • Save tonio-m/44cb5b502abc1235df005fbdd5396a0f to your computer and use it in GitHub Desktop.
Save tonio-m/44cb5b502abc1235df005fbdd5396a0f to your computer and use it in GitHub Desktop.
use ghostscript to invert colors of a pdf
#!/bin/bash
gs -o inverted.pdf \
-sDEVICE=pdfwrite \
-c "{1 exch sub}{1 exch sub}{1 exch sub}{1 exch sub} setcolortransfer" \
-f input.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment