跳到主要内容

解锁 PDFn8n

解锁 PDF 是一个 PDF4me 节点操作 n8n 这会移除密码保护。 PDF 输入正确的密码后,即可使用此功能。它可以让后续工作流程步骤读取受保护的文件,清除您拥有的存档中的加密,或者无需逐个打开即可解锁供应商发送的所有报表。

此节点的功能

PDF4me解锁 PDF 需要保护 PDF 来自二进制数据, Base64 String或者 URL它会应用你提供的密码,并返回一个无需提示即可打开的副本。 密码 此字段为必填项,因此它解锁的是您已获得授权打开的文档,而不是找回丢失的密码。它通常位于流程的前端,因为提取和转换步骤无法读取加密文件。

相关博客文章
目前尚无关于此功能的博客文章——敬请期待。
在此期间,您可以浏览 PDF4me 博客,查看适用于各平台的教程和工作流程。
访问博客

验证您的身份 API 要求

每一个 PDF4me 节点 n8n 需要有效 用于连接的凭证创建或选择一个可以容纳您的 PDF4me API 关键在于确保工作流程能够安全地验证解锁请求。

您不容错过的重要事实

需要密码
这不是密码恢复工具。没有正确的密码,无法通过此操作解锁文档。
解压前请先解锁
文本、表格和表单提取功能无法读取加密内容。 PDF因此,该节点通常位于工作流程的最开始。
请勿将密码包含在工作流程文件中
引用凭据或环境变量,而不是手动输入密钥,这样密钥就不会被包含在导出的工作流中。 JSON
n8n 中的 PDF4me 节点设置为“操作:解锁 PDF”,输入数据类型为二进制数据,输入二进制字段为 data,输出文件名为 unlocked_output.pdf,密码字段已屏蔽,二进制数据输出名称为 data。

PDF4me 解锁 PDF 参数面板 n8n

解锁 PDF 与保护文档

这两个操作是相反的,工作流程中经常会同时使用这两个操作:解锁传入的文件进行读取,然后在将结果发送出去之前重新保护它。

方面解锁 PDF保护文档
What it doesRemoves existing password protectionApplies password protection
Password you supplyThe current password on the documentThe new password you want to set
Typical positionFirst step, so later nodes can read the fileLast step, before the file is sent or stored
PrerequisiteYou must already know the passwordNone beyond the source document

解锁需要哪些参数? PDF 需要?

必需的: 操作、输入数据类型、与该输入类型匹配的字段、输出文件名和密码。二进制数据输出名称和自定义配置文件具有可用的默认值。

范围必需的它的作用例子
ActionRequiredSelects the PDF4me node action to run. Choose Unlock PDF.Unlock PDF
Input Data TypeRequiredFormat of the source PDF input. Choose Binary Data (from a previous node), Base64 String, or URL.Binary Data
Input Binary FieldConditionalName of the binary property on the incoming n8n item that holds the protected PDF. Required when Input Data Type is Binary Data. Defaults to data.data
Base64 Document ContentConditionalBase64-encoded content of the protected PDF. Required when Input Data Type is Base64 String.JVBERi0xLjQK...
File URLConditionalPublicly reachable HTTPS URL to the protected PDF. Required when Input Data Type is URL.https://example.com/statement.pdf
Output File NameRequiredFilename for the unlocked PDF returned by the node. Include the .pdf extension.unlocked_output.pdf
PasswordRequiredThe current password on the document. Shown masked in the panel. Reference a credential or environment variable rather than typing the secret into a saved workflow.{{ $env.PDF_PASSWORD }}
Binary Data Output NameOptionalName of the binary property the output item exposes. Defaults to data.data
Custom ProfilesOptionalAdvanced Options field for extra processing settings, supplied in a JSON-like format. Leave blank unless you have a specific profile to apply.{ "preserveMetadata": true }

输出字段

一次成功的运行返回一个 n8n 携带已解锁物品 PDF

场地类型它包含什么
Binary (data)BinaryThe unlocked PDF, under Binary Data Output Name (default data).
fileNameStringGenerated filename, matching Output File Name.
docNameStringName of the processed document, for reference and tracking.
mimeTypeStringMIME type of the output, always application/pdf.
fileSizeNumberSize of the returned PDF in bytes.
isUnlockedBooleanConfirms the document was unlocked. A useful assertion before handing the file to an extraction step.
securityRemovedBooleanConfirms password protection and access restrictions were removed.
successBooleanTrue when the unlock completed, false on failure such as a wrong password. Use it to branch error handling.
messageStringHuman-readable status message, carrying success confirmation or error detail.

如何设置解锁 PDFn8n

  1. 添加 PDF4me 致你 n8n 工作流程并选择 解锁 PDF 行动。
  2. 用于连接的凭证请选择您的 PDF4me 凭证或点击 创建新凭证 并粘贴你的 API 钥匙。
  3. 输入数据类型二进制数据 (默认), Base64 String, 或者 URL 并提供匹配的来源 PDF 场地。
  4. 输出文件名 对于已解锁的文件,以……结尾 .pdf
  5. 输入文档 密码理想情况下,应该使用读取凭据或环境变量的表达式。
  6. 离开 二进制数据输出名称 作为 data 除非后面的节点期望不同的属性。
  7. 执行节点并路由已解锁的流量 PDF 进入下一步,例如提取、转化或存储。

典型配置

工作流程示例Common n8n workflow patterns using Unlock PDF.
阅读受保护的银行对账单
  1. 账单会以电子邮件形式发送,并设有已知密码保护。
  2. 解锁 PDF 使用存储的密钥移除保护。
  3. 表格提取步骤将交易记录读取到工作表中。
来自自有存档的清晰加密
  1. 共享驱动器中的旧文档都使用相同的旧密码。
  2. 解锁 PDF 在迁移批次期间遍历每个文件。
  3. 未受保护的副本将进入新的文档系统,可供搜索。
解锁、处理,然后重新保护
  1. 解锁 PDF 打开一个受保护的传入文档。
  2. 工作流程会对可读文件进行盖章、合并或编辑。
  3. 在将文档重新发送之前,保护文档会应用一个新的密码。
用……保护管道 success 查看
  1. 解锁 PDF 尝试对每个到达的文件使用已存储的密码。
  2. IF 节点测试返回值 success 以及 isUnlocked 字段。
  3. 故障会发出警报,以便立即注意到密码已轮换。

实用技巧

Never hardcode the password
Use an expression that reads an n8n credential or environment variable, so the secret does not travel inside exported workflow JSON.
Put the unlock first
Extraction and conversion nodes cannot read an encrypted PDF, so unlocking early avoids confusing downstream failures.
Alert on a failed unlock
A rotated password will fail every run. Branch on success so it surfaces as an alert rather than a pile of stuck items.
Assert on isUnlocked before extracting
Checking the flag is cheaper than debugging an extraction node that received a file it could not open.
Only unlock what you are authorised to
The action needs the real password by design. Confirm you have the right to remove protection before automating it across an archive.
re-protect before sending outward
If the document leaves your systems again, add Protect Document at the end so the unlocked copy is not what gets distributed.

速查表

场地价值
ActionUnlock PDF
Input Data TypeBinary Data
Input Binary Fielddata
Output File Nameunlocked_output.pdf
Password{{ $env.PDF_PASSWORD }}
Binary Data Output Namedata
CredentialsPDF4me API credential

常见问题

Can Unlock PDF open a PDF when I do not know the password?+
No. The Password field is required and must match the password set on the document. The node removes protection from files you are already authorised to open; it is not a password recovery or cracking tool. If nobody in your organisation holds the password, the document cannot be unlocked through this action.
Where should I store the PDF password in n8n?+
Avoid typing it directly into the Password field on a saved workflow. Reference an n8n credential or an environment variable through an expression instead, so the secret is not stored in the workflow JSON that gets exported, shared, or committed to version control.
Does unlocking remove permission restrictions as well as the open password?+
The action removes the password protection so the returned file opens without a prompt, and the response includes a securityRemoved flag confirming restrictions were lifted. Encryption and permission handling are defined in the ISO 32000 PDF specification, so check that flag on a representative document before assuming a specific restriction such as printing or copying is gone.
Why unlock PDFs in a workflow instead of one at a time?+
Downstream steps such as text extraction, table parsing, and conversion cannot read an encrypted PDF. Putting Unlock PDF at the front of the workflow means every protected file that arrives is made readable automatically, rather than stalling the pipeline until someone opens each one by hand.
What happens if the password is wrong?+
The run fails rather than returning a partially unlocked file. Branch on the returned success boolean so a wrong or rotated password raises an alert instead of silently passing the still-encrypted original to the next step, where it would fail again less obviously.

相关操作

在其他平台上执行相同任务

获取帮助