InfoHeap
Tech tutorials, tips, tools and more
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 - 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 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 remove password from pdf using Chrome
  2. How to check if a user has password on Linux
  3. How to use preview to add password to pdf file on mac
  4. How to zip/unzip a directory with password
  5. How to view your WiFi password on Mac
  6. Linux – how to enable password login on ssh server
  7. Linux – how to add a user using useradd
  8. How to recover svn lost password on Linux
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Mac, Mac Command Line, PDF, Tutorials

Follow InfoHeap

facebook
twitter
googleplus
  • Browse site
  • Article Topics
  • Article archives
  • Recent Articles
  • Contact Us
  • Omoney
Popular Topics: AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | 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

Copyright © 2022 InfoHeap.

Powered by WordPress