Shell scripts for easy decrypting PDF files with password using qpdf and a GUI version with YAD
Find a file
2024-09-05 17:18:55 -03:00
img README.md improvement + icon in plain svg 2023-12-05 13:10:59 -03:00
.gitignore First version of qpdf-decode-gui, still needing polishing. 2023-12-16 21:53:04 -03:00
LICENSE.md - POSIX Shell compliance, tested with dash, posh and shellcheck 2023-12-04 23:44:11 -03:00
qpdf-decode Version 0.4.1: subtle fixes on GUI + improve README.md 2024-09-05 16:18:12 -03:00
qpdf-decode-gui Version 0.4.1: subtle fixes on GUI + improve README.md 2024-09-05 16:18:12 -03:00
qpdf-decode-gui.desktop Version 0.4.1: subtle fixes on GUI + improve README.md 2024-09-05 16:18:12 -03:00
README.md Improve README.me, GFDL 1.3. 2024-09-05 17:18:55 -03:00

qPDF Decode

Application icon depicting a white unlocked padlock on a red sheet of paper

Save a readable copy of your PDF after unlocking it with your passphrase.

Main repository: https://git.disroot.org/daltux/qpdf-decode

Dependencies

  • QPDF tool
    • versions tested: 11.6.3, 8.0.2
  • A POSIX-compliant Shell (/bin/sh)
  • If you would like to run the graphical user interface (qpdf-decode-gui):
    • YAD
      • Also, for installing it on the Applications menu of a desktop environment following XDG specifications:
      • tested on yad 0.40.0 from Debian, Xfce 4.18, GTK+ 3.24.38, also from Ubuntu 20.04, Unity 7.5.1., GTK 3.24.20 + 2.24.32
      • tested on yad 0.38.2 from Ubuntu 18.04

Contents

Besides auxiliary files, this project consists of two shell scripts:

  • qpdf-decode - main command-line interface that uses QPDF
  • qdf-decode-gui - graphical user interface using YAD for creating dialogs

Getting it (suggestion)

  1. Check if the dependencies are available and install them if necessary.
    • Example on Debian: install package qpdf. For the GUI, install yad and, optionally, xdg-utils if you would like to set the desktop environment menu item.
      • Run as root: apt install qpdf yad xdg-utils
  2. Clone the Git repository or decompress a zip/tar copy somewhere on your filesystem.
  3. Check if you have permission to execute qpdf-decode and qpdf-decode-gui and fix it if necessary.
    • Example: chmod +x qpdf-decode qpdf-decode-gui
  4. Create symbolic links to qpdf-decode and qpdf-decode-gui somewhere on your PATH, e.g. /usr/local/bin (for all users) or your own ~/bin
  5. Run qpdf-decode-gui --install if you would like to set a desktop environment applications menu item. If you run it as root, it will be installed for all users, else only for the running user.
  6. Check all the options by running qpdf-decode --help or qpdf-decode-gui --help

Using the GUI 🖱️

If you successfully installed the desktop applications menu item (qpdf-decode-gui --install), qPDF Decode should be available under categories "Office" or "Viewer". See file qpdf-decode-gui.desktop for technical details.

When the GUI is started from the desktop menu or the command is directly called with no parameters (qpdf-decode-gui), a file selection dialog will be open on screen. Choose the PDF intended to be decrypted.

Another file selection dialog lets the user choose a destination file path and name where the decrypted version is going to be saved. If unset, default resulting file will be the same as the first one, adding a suffix "_decrypted.pdf".

Next, a text input field will ask the file decryption passphrase.

The script will call qpdf to try decrypting the file and, if succeeded, you should be able to open the resulting file with the default PDF viewer or just end.

Opening a file from another application

The main use case of this project, a personal problem the author would like to address, is saving decrypted versions of PDF invoices having password, often received by email. With all the tools we commonly have on our desktop environment, it is still a somewhat slow and error-prone procedure. qPDF Decode (GUI) is a direct attempt to make this situation easier.

qPDF Decode should be set on the desktop environment as a secondary application to open PDF files. This is easily done e.g. when you choose to open a PDF file with qPDF Decode for the first time, from an email, a file manager or other application. Just avoid setting it as the default application, which should continue to be a PDF viewer.

Development

This project is still in early phase, but already functional. However, some development is yet to happen on important functionality it still misses such as localization All strings are hard coded in English.

If you would like to register any kind of feedback, please open an issue report on Disroot Forgejo.

Help is needed on testing the scripts on different environments. Please let us know if it works for you or not.

Shell scripting development itself is just a matter of using a plain text editor on almost the same execution environment as long as it is not too much bleeding-edge. Try to follow POSIX and use ShellCheck to validate against common errors.

The project's Disroot Forgejo Git repository is where pull requests should be sent to as well.

GPLv3 - Free Software - Free as in Freedom

Copyright © 2023,2024 Daltux

qPDF Decode is Free Software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Documentation license

GFDL logo

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; see the license text for details.

Acknowledgements