InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Mac Command Line tutorials

  • Bulk convert jpeg files to png using sips on mac
  • Custom terminal tab title and ssh on mac
  • How to convert text to speech on Mac using command line utility say
  • How to join multiple pdf files on Mac
  • How to use qpdf to add/remove password from pdf on mac
  • Install redis on Mac
  • Mac - find which process is listening on a port
  • Mac - hide and unhide a file or directory
  • Mac - open a terminal from a folder
  • Mac - print java home on command line
  • Mac - search files on command line using mdfind
  • Mac command line convert svg to png
  • Mac command line utility open - some handy tips for better productivity
  • Mac terminal - how to close shell on exit
  • mac pkgutil - quick start guide
 
  • Home
  • > Tutorials
  • > Mac
  • > Mac Command Line

How to use qpdf to add/remove password from pdf on mac

By admin on Nov 6, 2015

Sometimes we need to add or remove passwords from a pdf file. You can do it using Google Chrome or many other UI tools also. In case you need to do it more often and want to use command line, the qpdf is a good option. These are steps to add or remove passwords from a pdf on Mac. Similar instruction should also work for Linux.

First install qpdf using the following command:

$ brew install qpdf

Add password to pdf

To add password to pdf document, you can use the following command:

$ qpdf --encrypt test123 test123 40 -- doc_without_pass.pdf doc_with_pass.pdf

Note that test123 is both user and owner password here and key lenght is 40.

You can try opening the document and it should ask you to enter the password:

$ open doc_with_pass.pdf

Remove password from pdf

To remove password from pdf document, you can use the following command:

qpdf --password=test123 --decrypt doc_with_pass.pdf doc_without_pass2.pdf

This will create doc_without_pass2.pdf file which should open without a password.

Suggested posts:

  1. How to install new fonts in Photoshop on Windows
  2. How to enable/disable gmail inbox category tabs
  3. How to print javascript object to log
  4. Find recently modified files on Linux
  5. How to join multiple pdf files on Mac
  6. How to view wifi connection speed on Mac
  7. Linux how to modify a user using usermod
  8. WordPress – get wpdb class method names
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Mac, Mac Command Line, PDF, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress