Git Product home page Git Product logo

pdf-manager's Introduction

PDF manager to lock or unlock your PDFs

This python program allows the user to unlock or lock several PDFs in one click. It uses a configuration file to set where the original PDFs are, where the locked/unlocked PDFs will be saved and the password. This program reads the config.txt file or uses the command line configuration. In the config.txt file is used, the first line of config.txt is the name of the source folder where the original PDFs are, the second line is the name of the destination folder where the locked/unlocked PDFs will be saved and the third line is the password. The default names are "Original PDF", "Modified PDF" and "password". Next, a folder named "Modified PDF" will be created if it doesn't already exist. Finally, the program prints out the number of PDF unlocked.

Getting Started

Prerequisites

Install pikepdf

Open a command window and type pip install pikepdf

Edit the configuration file

Open config.txt file and change the lines using a text editor. The first line is the name of the source folder where the original PDFs are, by default is "Original PDF". The second line is the name of the destination folder where the locked/unlocked PDFs will be saved, by default is "Modified PDF". The third line is the password, by default is "password".

Prepare the files

Create a new folder called "Original PDF" or with the same name as the first line of the file config.txt and copy the PDF files you want to lock/unlock.

Usage

usage: main.py [-h] [-f | -c] [-l | -u]

Lock or unlock your PDF

optional arguments:
  -h, --help          show this help message and exit
  -f, --file          Use the configuration file
  -c, --command_line  Configure the cript using the command line
  -l, --lock          Lock your PDF(s) with password
  -u, --unlock        Unlock your PDF(s)

You can either use the configuration file config.txt (using argument -f or --file) or the command line option (using argument -c or --command_line), moreover you can lock your PDF(s) (using argument -l or --lock) or unlock your PDF(s) (using argument -u or --unlock).

Example

  • If you want to use the configuration file config.txt and lock your PDF(s), open the Command Prompt as Administrator and type python .\main.py -f -l.

  • If you want to use the configuration file config.txt and unlock your PDF(s), open the Command Prompt and type python .\main.py -f -u.

  • If you want to use the command line and lock your PDF(s), open the Command Prompt as Administrator and type python .\main.py -c -l. Next, the command window will show you

Insert source folder name:
Insert destination folder folder name:
Insert password:
  • If you want to use the command line and unlock your PDF(s), open the Command Prompt and type python .\main.py -c -u. Next, the command window will show you
Insert source folder name:
Insert destination folder folder name:
Insert password:

pdf-manager's People

Contributors

matteoorlandini avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.