Edit Documents from Paperless Directly in LibreOffice
After migrating my document archive from ecoDMS to Paperless-ngx, I found myself missing a feature that had become part of my daily routine. In ecoDMS, it was possible to open a document in the archive and save it back there directly. The document had to be opened in the archive client, but saving could then be done directly from within LibreOffice. I’m familiar with this from other document management solutions as well—for example, the one I use at work. Paperless-NGX doesn’t offer this integration. However, using the provided API, it’s possible to add this functionality: open a document, make changes, and save the new version back to the archive—without having to go through the extra steps of downloading, editing, and uploading. I created the add-on using AI (Anthropic Claude) and tested it on my system. It should work on both Windows and Linux operating systems.
What It Can Do
A dedicated toolbar with five commands appears in LibreOffice:
Open from Paperless — Search box, list of results, and below that, the versions of the selected document with dates and file formats. The original is loaded, not the archived version generated by Paperless.
Save as a New Version — The edited version is appended to the same document. The previous version is retained.
Save to Paperless — either as a new document with its own version history, or as a new version of a different existing document. The second option fills a gap that document management systems often leave open: The invoice is archived as a PDF, and the editable version is created later. The two belong together, but the PDF was there first.
Edit classification — title, date, correspondent, document type, tags. Unknown values are added after confirmation.
Generate sharing link — time-limited, accessible without logging in, and optionally with a tag on the document so that shared documents can be easily found later via search.
Saving natively is still possible
The extension does not hook into the normal Save button. Pressing Ctrl+S saves locally—nothing happens in the archive. Technically, the other approach would be possible, but it would be complex: integrating Paperless as a genuine save destination into the file dialogs requires a UCB Content Provider. That involves C++ work in a very poorly documented corner of LibreOffice. In terms of functionality, I consider the dedicated buttons to be the better approach anyway. Creating a new version in the archive is a deliberate action, not a side effect of pressing a key.
Versions with Format
One detail that has proven important in practice: The version list shows not only the number and date but also the file format. The reason is practical. A document may have been added to the archive as a PDF, and later an editable ODF version was attached—or vice versa. Opening the version at the top of the list might then be pointless. Non-editable formats are marked and suggested to be opened as read-only. Suggested, not enforced: Format detection can be wrong, and in that case, you should still be allowed to open the document in editable mode.
Security
The most delicate step is opening the file. A document from the archive is third-party content—even if it’s from your own collection, since that’s where files from email attachments, scanner folders, and network shares end up. An ODT or DOCX file may contain macros.
The extension therefore loads with MacroExecutionMode = NEVER_EXECUTE. Macros are not executed, not even after confirmation—there is no yellow bar that someone could accidentally click to enable them. Additionally, UpdateDocMode = NO_UPDATE ensures that no external content is reloaded upon opening.
Additional points: File names from the server response are fully sanitized, the working directory is located in the user profile instead of in /tmp, and only http and https are accepted as base addresses.
A detailed analysis is included in the repository.
What the Add-On Cannot Do
- No protection against parser vulnerabilities in LibreOffice itself. A specially crafted document that triggers a memory error will work regardless of the loading settings. The only solution is to keep LibreOffice up to date.
- No conflict resolution. Paperless does not use locks; if two users work on the same document at the same time, it creates two versions instead of resolving a conflict.
- The token is stored in plain text in the settings file. This is standard practice for desktop applications, but it does not provide secure storage. I recommend using a separate token for the extension—this allows it to be revoked individually.
Installation
Paperless-ngx 3.0 or newer is required—document versioning is only available starting with that version. Installation is done as usual via the extension manager included in LibreOffice. From there, select “Install from a file” and open the downloaded file.
Another requirement is that Python be installed on your computer. Downloads are available for Windows from the official download section of python.org and for Linux via the system’s package managers.
LibreOffice must be completely closed, including the Quick Launcher. Then, under Tools → Paperless → Set Up Connection, enter the base address and an API token. The token is generated in the Paperless user profile, not in the general settings.
The interface is available in German, English, and French.
Source Code
All under the MIT License:
Git Repository: LibreOffice Connector Add-on
The extension is written in Python with UNO integration and does not require any third-party libraries—the Python runtime included with LibreOffice only provides the standard library, so everything runs via urllib, including a custom multipart upload.
It has been tested on a single instance but has not undergone formal testing. Feedback is welcome.