Last active
          June 20, 2022 02:19 
        
      - 
      
- 
        Save kevcjones-archived/4483127 to your computer and use it in GitHub Desktop. 
    Unlocking a PDF using ghostscript
  
        
  
    
      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
    
  
  
    
  | required - install ghost script - e.g brew install ghostscript (takes a few minutes) | |
| update this line as needed and run in terminal | |
| -- New and updated thanks to comments -- | |
| gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -SPDFPassword=THE_PASSWORD -sOutputFile=unencrypted.pdf -c .setpdfwrite -f 2017-06-13-11-55-56-188_14972345156188_XXXPT6345X_ITRV.pdf | |
| -- Original -- | |
| gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf | 
Exactly what @mustaqimM said. Thanks, @denysvega! Worked for me too.
I've updated the original gist now - cheers @denysvega
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
@denysvega Thank you so much for your comment. It's the only one that works