Press ESC to close

Paperless: How to enable upload of digitally signed PDF files

Table of contents

Hello!

Today I’m going to show you how to set up the ability to upload digitally signed files (such as invoices, accounting documents or court letters) to Paperless-ngx in a very simple way.

Introduction

What is Paperless-ngx?

Icon: Paperless-ngxPaperless-ngx is a modern open source solution for paperless document management. It is a fork of the Paperless project, which is designed to scan, tag, search and manage digital copies of paper documents to minimize the need to store physical copies. Paperless-ngx offers a variety of improvements over the original design, including better user interface support, more advanced search options, automatic tagging of documents based on their content, and OCR (optical character recognition) support in multiple languages, allowing for easier management and retrieval of documents in the database.

This project is particularly useful for individuals and companies seeking to reduce the amount of paper in their work and daily lives. It offers a simple and efficient way to organize digital documents.

Genesis of the issue

By default, the system blocks such files due to the presence of a digital signature. He suggests that an OCR operation could alter the contents of a document, thus invalidating its signature. However, there is a way around this limitation to ensure that all documents, including those bearing a digital qualified signature, are managed.

The error that appears in the logs is:

DigitalSignatureError: Input PDF has a digital signature. OCR would alter the document, invalidating the signature.

Step 1 – Installing Paperless-ngx on a Synology server

If you have not yet installed Paperless-ngx on your Synology device, I strongly encourage you to read this article. You will learn from it how to set up a paperless document management system. This is a great opportunity to start taking advantage of Paperless-ngx’s advanced capabilities for easy organization and secure document storage.

Step 2 – Edit parameters in Docker Compose

In step 2, we’ll look at editing the parameters in the Docker Compose file to enable the advanced OCR options in Paperless-ngx. This is a key part of the setup, allowing the OCR process to be tailored to specific needs, including processing digitally signed PDF documents.

  • Log in to your account and go to the administrative interface of the Portainer.
    • If you are using the Authentik single sign-on system, you can make the login process easier by integrating Portainer with Authentik. For integration instructions, see the dedicated guide.
  • Select your environment (eng: Environments) in which you will edit the configuration of the created Docker Compose. Then go to Stacks.

Guide to installing Traccar on Synology in Docker

  • Select the created Stack named paperless-ngx (or named according to you, corresponding to Paperless).
  • Add a parameter to Environment at the Paperless-ngx Web server as described below:
PAPERLESS_OCR_USER_ARGS: '{"invalidate_digital_signatures": true}'

The parameter PAPERLESS_OCR_USER_ARGS: ‘{“invalidate_digital_signatures”: true}’ in the context of Paperless-ngx and OCRmyPDF allows OCR processing of PDF documents that have been digitally signed by intentionally invalidating those signatures. In its standard configuration, OCRmyPDF does not process documents with digital signatures so as not to compromise their integrity. Setting this parameter to true allows OCR on such documents, but as a consequence invalidates their digital signatures, which can be useful in certain usage scenarios.

  • Click Deploy the stack, then wait until Portainer processes the new content and creates the containers again.

If you have additional questions about the setup, go ahead and leave a comment under this article or contact me directly. I will be happy to answer any concerns and help solve any problems. Your questions can help improve this guide for other users.

Additional Sources and information

Configure Single Sign-On (SSO) between Authentik and Paperless-ngx using OpenID Connect to increase the convenience of logging in and security of access to your document management system. Learn the steps needed to integrate these two powerful tools and enjoy a smoother authentication process.

👉 Learn more about the process and make your login management easier.

For further exploration and more information, I recommend checking out the links below. They are valuable sources that were used in the development of this guide:

Read also

Filip Chochół

Filip Chochol runs two blogs: personal “chochol.io” and together with his girlfriend “Warsaw Travelers” about travel. He specializes in IT resource management and technical support, and has been active in the field of cyber security awareness for almost two years. A proponent of open-source technologies, he previously worked in the film and television industry in the camera division (2013-2021). After hours, he develops interests in smart homes and networking.

Comments (1)

  • Gravatar

    Sergiosays:

    18/09/2024 at 09:44

    What if I want to store the digitally signed document WITHOUT ocr?
    I don’t want to leave digital sign.

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.