Nodes/ComfyUI_Fill-Nodes/FL PDF Encryptor
ComfyUI Node

FL PDF Encryptor

Password-protect a PDF with granular permission controls

By filliptm·Created 3 years ago·Updated about 17 hours ago· 628
FL PDF Encryptor
  • pdf
  • PDF
user_password
owner_password
encryption_level128-bit
allow_printingtrue
allow_commentingtrue
allow_copyingtrue
allow_content_extractiontrue
allow_form_fillingtrue
allow_document_assemblytrue
allow_page_extractiontrue

If your ComfyUI workflow ends in a generated PDF - a report, a document assembled from FL_TextToPDF or FL_ImagesToPDF, whatever - and you need to lock it down before it goes out the door, FL_PDFEncryptor is the last step in that chain. It's built on PyPDF2 and gives you real password protection plus fine-grained permission flags, not just a single "encrypted or not" toggle.

How it works

PDF encryption actually supports two separate passwords with different meanings, and this node exposes both. The user password is what someone needs to open the file at all. The owner password is what's needed to change permissions or bypass the restrictions below - a PDF can be freely openable (no user password) while still being locked against copying or printing, or it can require a password just to open, or both. encryption_level picks between 40-bit and 128-bit - 128-bit is the modern default and the one you should use unless you have a specific reason to target an ancient PDF reader that only supports the weaker standard.

The permission flags (allow_printing, allow_copying, allow_commenting, allow_form_filling, allow_content_extraction, allow_document_assembly, allow_page_extraction) all default to true - meaning by default, setting a user password locks opening the file but doesn't restrict what someone can do once they're in. Worth knowing: PDF permission flags are a convention respected by well-behaved readers, not a hard technical barrier - a determined person with the right tools can strip these restrictions. Treat this as a normal-user-friction control, not real security against a motivated adversary; the user password (which genuinely requires decryption to bypass) is the actual access barrier.

The inputs and outputs that matter

  • pdf (PDF) - a Fill-Nodes PDF object, from FL_PDFLoader, FL_TextToPDF, FL_ImagesToPDF, or another node in this pack's PDF group. Not a raw file path.
  • user_password / owner_password - leave either blank if you don't need that layer; you can set just one.
  • encryption_level - 128-bit unless you specifically need legacy compatibility.
  • The seven allow_* booleans - flip off whichever permissions you actually want restricted once the file's opened.
  • Output: PDF - the encrypted document, ready to hand to FL_PDFSaver to write it to disk.

How to install it

Via ComfyUI Manager: search "ComfyUI_Fill-Nodes" and install. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes

then restart ComfyUI. This whole PDF node group runs on PyPDF2 - worth knowing if install ever complains about a missing package, since it's a real dependency separate from ComfyUI's core install. The broader pack is a large, general-purpose collection from filliptm, one prolific solo author, also covering image FX, GPT/Gemini/Fal API wrappers, and an entire KSampler family; the PDF tools are one self-contained corner of it.

Common issues & troubleshooting

File opens with no password prompt at all. Check that user_password is actually set - an owner password alone restricts permissions but doesn't require a password to open the document.

Recipient can still copy/print despite the restrictions. As above - that's the nature of PDF permission flags, not a bug in this node. They rely on the PDF reader honoring them; some readers and most command-line PDF tools ignore them entirely.

Downstream node rejects the output. Remember the PDF type here is Fill-Nodes-specific, produced and consumed by this pack's own PDF nodes (FL_PDFSaver, FL_PDFMerger, etc.) - it's not a raw file path or bytes object you can wire into an arbitrary file-writing node without going through FL_PDFSaver first.

Category🏵️Fill Nodes/PDF

Inputs (11)

NameTypeDefaultDescription
pdfPDF
user_passwordSTRING
owner_passwordSTRING
encryption_levelCOMBO128-bit2 options: 40-bit, 128-bit
allow_printingoptBOOLEANtrue
allow_commentingoptBOOLEANtrue
allow_copyingoptBOOLEANtrue
allow_content_extractionoptBOOLEANtrue
allow_form_fillingoptBOOLEANtrue
allow_document_assemblyoptBOOLEANtrue
allow_page_extractionoptBOOLEANtrue

Outputs (1)

NameTypeDescription
PDFPDF