8
n8n 中文网amn8n.com

符合PAdES标准的PDF数字签名API

高级

这是一个Document Extraction领域的自动化工作流,包含 65 个节点。主要使用 If, Set, Switch, Webhook, HttpRequest 等节点。 使用X.509证书按照PAdES标准签署PDF文档

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "DoTG98mBAQo2SOCm",
  "meta": {
    "instanceId": "5c7ce220523e8664f49208a8be668a8dc6fab5f747ce4de865fa1309727919f1"
  },
  "name": "符合 PAdES 标准的 PDF 数字签名 API",
  "tags": [],
  "nodes": [
    {
      "id": "42bd1f69-5f53-49b7-a1a7-10ebb299a3d8",
      "name": "检查 Java",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        -2944,
        480
      ],
      "parameters": {
        "command": "which keytool"
      },
      "typeVersion": 1
    },
    {
      "id": "1b2eaa5a-31f4-4bed-80da-14b595c2ad86",
      "name": "Java 缺失?",
      "type": "n8n-nodes-base.if",
      "position": [
        -2752,
        480
      ],
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{ $json.exitCode }}",
              "operation": "smallerEqual"
            }
          ],
          "string": [
            {
              "value1": "={{ $json.error }}",
              "value2": "keytool",
              "operation": "notContains"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e48c0bca-cc69-48e2-b921-2eb065c82a5e",
      "name": "获取安装脚本",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2544,
        288
      ],
      "parameters": {
        "url": "https://raw.githubusercontent.com/vighsandor/n8n-externals/main/landingpages-for-pdfsign-workflow/install-deps.sh",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "installdeps"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4f9ea5c0-06f7-4780-94d2-9267d0906a17",
      "name": "写入安装脚本",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -2544,
        432
      ],
      "parameters": {
        "options": {},
        "fileName": "/tmp/install-deps.sh",
        "operation": "write",
        "dataPropertyName": "installdeps"
      },
      "typeVersion": 1
    },
    {
      "id": "655b1703-3140-4ba5-9c3e-7cb1823087f5",
      "name": "安装依赖项",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        -2544,
        592
      ],
      "parameters": {
        "command": "sh /tmp/install-deps.sh"
      },
      "typeVersion": 1
    },
    {
      "id": "15d3a575-813d-4744-ac75-dc8b62721eff",
      "name": "提取密码",
      "type": "n8n-nodes-base.set",
      "position": [
        -1840,
        480
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "pfx-pass",
              "name": "pfxPassword",
              "type": "string",
              "value": "={{ $('Webhook').item.json.body.pfxPassword }}"
            },
            {
              "id": "timestamp",
              "name": "timestamp",
              "type": "string",
              "value": "={{ Date.now() }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "d5069001-989f-4464-b439-a716c10b5fe1",
      "name": "读取已签名的 PDF",
      "type": "n8n-nodes-base.readBinaryFile",
      "position": [
        1088,
        480
      ],
      "parameters": {
        "filePath": "=/tmp/output_{{ $('Extract Password').item.json.timestamp }}.pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "ebe22a19-cc73-4fd3-989c-0391e7c16ad9",
      "name": "返回已签名的 PDF",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1296,
        480
      ],
      "parameters": {
        "options": {
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "application/pdf"
              },
              {
                "name": "Content-Disposition",
                "value": "attachment; filename=\"signed.pdf\""
              }
            ]
          }
        },
        "respondWith": "binary"
      },
      "typeVersion": 1
    },
    {
      "id": "6819e701-ddbb-4628-b3d3-e17d1dc60505",
      "name": "获取清理脚本",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1296,
        688
      ],
      "parameters": {
        "url": "https://raw.githubusercontent.com/vighsandor/n8n-externals/main/landingpages-for-pdfsign-workflow/cleanup.sh",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "cleanup"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4b2703b8-0fb9-43d2-ae52-ed96377bab3a",
      "name": "写入清理脚本",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        1472,
        688
      ],
      "parameters": {
        "options": {},
        "fileName": "/tmp/cleanup.sh",
        "operation": "write",
        "dataPropertyName": "cleanup"
      },
      "typeVersion": 1
    },
    {
      "id": "176c4f1c-240b-4327-a5dc-a2144ea80460",
      "name": "清理",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        1648,
        688
      ],
      "parameters": {
        "command": "=sh /tmp/cleanup.sh {{ $('Extract Password').item.json.timestamp }}"
      },
      "typeVersion": 1
    },
    {
      "id": "04d5cd52-8db9-4b86-86fc-bc47b3e1b027",
      "name": "添加 Codegic 信任",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        -1504,
        176
      ],
      "parameters": {
        "command": "=sh /tmp/addtestcatrust.sh"
      },
      "typeVersion": 1
    },
    {
      "id": "8837fb0b-c411-4091-bf8d-be3f716cb4ce",
      "name": "无可见签名?",
      "type": "n8n-nodes-base.if",
      "position": [
        -416,
        480
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "570fb094-af64-4063-80e1-00b704b81168",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $('Webhook').item.json.body.isVisible }}",
              "rightValue": "false"
            },
            {
              "id": "58871fba-db23-43f5-aab8-82bdae666feb",
              "operator": {
                "type": "string",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $('Webhook').item.json.body.isVisible }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "2f1ec2b2-abc4-4a0e-a7d5-ef73539f0362",
      "name": "切换签名可见性",
      "type": "n8n-nodes-base.switch",
      "position": [
        -16,
        448
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "BASELINE-B",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d06157a1-c54c-49f4-9e0b-bfc70138d3a2",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Webhook').item.json.body.signLevel }}",
                    "rightValue": "B"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "BASELINE-T",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "1900ec58-0ac8-4434-a2ac-ac5449eecee6",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Webhook').item.json.body.signLevel }}",
                    "rightValue": "T"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "BASELINE-LT",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "0d76968b-28e2-4101-b46a-8e4589457ea5",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Webhook').item.json.body.signLevel }}",
                    "rightValue": "LT"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "BASELINE-LTA",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "ccfb4d79-f571-471d-ac49-df0e31edacd0",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Webhook').item.json.body.signLevel }}",
                    "rightValue": "LTA"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "60a1875d-da5f-4cb1-b4a7-2546af3c55bf",
      "name": "写入文件:PDF",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -3120,
        224
      ],
      "parameters": {
        "options": {},
        "fileName": "/tmp/testpdf.pdf",
        "operation": "write",
        "dataPropertyName": "pdfFile"
      },
      "typeVersion": 1
    },
    {
      "id": "cb2b0233-7ff4-4fd1-8572-ecfa1db1d548",
      "name": "写入文件:PFX",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -3136,
        480
      ],
      "parameters": {
        "options": {},
        "fileName": "/tmp/testcert.pfx",
        "operation": "write",
        "dataPropertyName": "pfxFile"
      },
      "typeVersion": 1
    },
    {
      "id": "76f2d0a6-22a4-4322-9967-3ec2e957e32c",
      "name": "写入文件:LOGO",
      "type": "n8n-nodes-base.readWriteFile",
      "onError": "continueRegularOutput",
      "position": [
        -3120,
        704
      ],
      "parameters": {
        "options": {},
        "fileName": "/tmp/logo.png",
        "operation": "write",
        "dataPropertyName": "logoFile"
      },
      "typeVersion": 1
    },
    {
      "id": "019bc397-be12-42cb-9de7-7c5cc8e8d37a",
      "name": "写入 JAR",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -2032,
        480
      ],
      "parameters": {
        "options": {},
        "fileName": "/tmp/open-pdf-sign.jar",
        "operation": "write",
        "dataPropertyName": "open-pdf-sign"
      },
      "typeVersion": 1
    },
    {
      "id": "c149f45c-1175-47c5-a8fe-7802e7dc1110",
      "name": "获取 JAR",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2256,
        480
      ],
      "parameters": {
        "url": "https://github.com/open-pdf-sign/open-pdf-sign/releases/download/v0.3.0/open-pdf-sign.jar",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "open-pdf-sign"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e822ed1b-5d8c-48c9-970f-44bcd358532b",
      "name": "获取处理脚本",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -752,
        480
      ],
      "parameters": {
        "url": "https://raw.githubusercontent.com/vighsandor/n8n-externals/main/landingpages-for-pdfsign-workflow/processpdf.sh",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "processpdf"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e16405b9-9f33-44ae-844f-41e91ec0a0c1",
      "name": "写入处理脚本",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -576,
        480
      ],
      "parameters": {
        "options": {},
        "fileName": "/tmp/processpdf.sh",
        "operation": "write",
        "dataPropertyName": "processpdf"
      },
      "typeVersion": 1
    },
    {
      "id": "1ae7737c-06ed-4c2d-9365-59811698fb48",
      "name": "获取信任脚本",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1840,
        176
      ],
      "parameters": {
        "url": "https://raw.githubusercontent.com/vighsandor/n8n-externals/main/landingpages-for-pdfsign-workflow/addtestcatrust.sh",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "addtestcatrust"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0b230a4f-39b2-4d12-86e8-c32423e427f8",
      "name": "写入信任脚本",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -1664,
        176
      ],
      "parameters": {
        "options": {},
        "fileName": "/tmp/addtestcatrust.sh",
        "operation": "write",
        "dataPropertyName": "addtestcatrust"
      },
      "typeVersion": 1
    },
    {
      "id": "dc14cc4f-c376-4dfb-af97-f6079d4ce94e",
      "name": "获取证书脚本",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1296,
        480
      ],
      "parameters": {
        "url": "https://raw.githubusercontent.com/vighsandor/n8n-externals/main/landingpages-for-pdfsign-workflow/pfx-split.sh",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "pfx-split"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6c9a35bf-a98e-4ee0-8c63-9442dc236c30",
      "name": "写入证书脚本",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -1120,
        480
      ],
      "parameters": {
        "options": {},
        "fileName": "/tmp/pfx-split.sh",
        "operation": "write",
        "dataPropertyName": "pfx-split"
      },
      "typeVersion": 1
    },
    {
      "id": "e6bea17e-1737-463d-a4b7-cc30752e0628",
      "name": "运行证书脚本",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        -944,
        480
      ],
      "parameters": {
        "command": "=sh /tmp/pfx-split.sh /tmp/cert_{{ $('Extract Password').item.json.timestamp }}.pfx {{ $('Extract Password').item.json.pfxPassword }} {{ $('Extract Password').item.json.timestamp }}"
      },
      "typeVersion": 1
    },
    {
      "id": "452d0354-b8f7-41d5-a339-d98c80909148",
      "name": "读取 PDF",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -1664,
        480
      ],
      "parameters": {
        "options": {
          "dataPropertyName": "toProcess"
        },
        "fileSelector": "/tmp/testpdf.pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "1dc95284-a0f3-48ff-85d6-5c2a54751441",
      "name": "写入 PDF",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -1664,
        688
      ],
      "parameters": {
        "options": {},
        "fileName": "=/tmp/input_{{$('Extract Password').item.json.timestamp }}.pdf",
        "operation": "write",
        "dataPropertyName": "toProcess"
      },
      "typeVersion": 1
    },
    {
      "id": "131635d9-bcaa-48bc-8a4d-2a71c3b7c7a8",
      "name": "读取 PFX",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -1472,
        480
      ],
      "parameters": {
        "options": {
          "dataPropertyName": "withProcess"
        },
        "fileSelector": "/tmp/testcert.pfx"
      },
      "typeVersion": 1
    },
    {
      "id": "02b89e37-d4e5-4fed-a89d-a4731a79b558",
      "name": "写入 PFX",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -1472,
        688
      ],
      "parameters": {
        "options": {},
        "fileName": "=/tmp/cert_{{ $('Extract Password').item.json.timestamp }}.pfx",
        "operation": "write",
        "dataPropertyName": "withProcess"
      },
      "typeVersion": 1
    },
    {
      "id": "5049c1f0-919b-461b-8b88-25520a192c10",
      "name": "显示可见签名",
      "type": "n8n-nodes-base.set",
      "position": [
        -240,
        608
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "88d2ec97-a1bb-4576-ae17-16292eca4910",
              "name": "visibleParams",
              "type": "string",
              "value": " -v -p 1"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "e16168a3-227e-43b5-bd4c-4fa721a3130a",
      "name": "无可见签名",
      "type": "n8n-nodes-base.set",
      "position": [
        -240,
        352
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "88d2ec97-a1bb-4576-ae17-16292eca4910",
              "name": "visibleParams",
              "type": "string",
              "value": " "
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "3e55deee-e7c0-4838-b65e-bd6e96fd718b",
      "name": "B",
      "type": "n8n-nodes-base.set",
      "position": [
        368,
        192
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "88d2ec97-a1bb-4576-ae17-16292eca4910",
              "name": "signatureLevel",
              "type": "string",
              "value": " basic"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "5c392f56-ad92-477a-8acf-6b1ffa11a5a0",
      "name": "T",
      "type": "n8n-nodes-base.set",
      "position": [
        368,
        416
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "88d2ec97-a1bb-4576-ae17-16292eca4910",
              "name": "signatureLevel",
              "type": "string",
              "value": "timestamp"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "8ec7897f-6d43-4d5e-befc-d96f3954ad22",
      "name": "LT",
      "type": "n8n-nodes-base.set",
      "position": [
        368,
        624
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "88d2ec97-a1bb-4576-ae17-16292eca4910",
              "name": "signatureLevel",
              "type": "string",
              "value": "baseline-lt"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "d708bee2-bd62-478b-8e7f-f5d48140b9d1",
      "name": "LTA",
      "type": "n8n-nodes-base.set",
      "position": [
        368,
        832
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "88d2ec97-a1bb-4576-ae17-16292eca4910",
              "name": "signatureLevel",
              "type": "string",
              "value": "baseline-lta"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "26107a33-9807-4cad-90f2-4b59ae072cbb",
      "name": "组件",
      "type": "n8n-nodes-base.set",
      "position": [
        672,
        480
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "88d2ec97-a1bb-4576-ae17-16292eca4910",
              "name": "components",
              "type": "string",
              "value": "=-i /tmp/input_{{ $('Extract Password').item.json.timestamp }}.pdf -o /tmp/output_{{ $('Extract Password').item.json.timestamp }}.pdf -c /tmp/cert_{{ $('Extract Password').item.json.timestamp }}.pem -k /tmp/key_{{ $('Extract Password').item.json.timestamp }}.pem"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "ade49a30-3227-449c-9d3d-58ef6825bb8d",
      "name": "签署 PDF",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        880,
        480
      ],
      "parameters": {
        "command": "=sh /tmp/processpdf.sh {{ $json.components }} -m {{ $json.signatureLevel }} {{ $json.visibleParams }}"
      },
      "typeVersion": 1
    },
    {
      "id": "03cd41c2-cd33-4d21-9f18-5b9e2a780858",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1936,
        -16
      ],
      "parameters": {
        "width": 624,
        "height": 368,
        "content": "## 测试帮助"
      },
      "typeVersion": 1
    },
    {
      "id": "dc78b230-94a1-43f3-be40-756cdb9f4363",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        -112
      ],
      "parameters": {
        "width": 304,
        "height": 656,
        "content": "## 测试帮助"
      },
      "typeVersion": 1
    },
    {
      "id": "d7b0f47b-7d52-4d81-869a-e19f577a3106",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        1008
      ],
      "parameters": {
        "color": 5,
        "width": 592,
        "height": 352,
        "content": "## 实现信息:"
      },
      "typeVersion": 1
    },
    {
      "id": "cda022d3-006e-436e-a3ab-7aa51cc20a34",
      "name": "## 1. 创建新的自定义 OpenAI 凭据",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        192
      ],
      "parameters": {
        "color": 4,
        "width": 432,
        "height": 224,
        "content": "## 响应处理"
      },
      "typeVersion": 1
    },
    {
      "id": "71d0eec1-cbe1-4d88-b7c8-bb742f366b94",
      "name": "便签14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3328,
        912
      ],
      "parameters": {
        "color": 4,
        "width": 464,
        "height": 336,
        "content": "## 配置说明"
      },
      "typeVersion": 1
    },
    {
      "id": "f002d95f-6978-452c-bd80-6b731f727d4b",
      "name": "GET 模型",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3632,
        608
      ],
      "parameters": {
        "color": 4,
        "width": 368,
        "height": 288,
        "content": "## 工作流入口点"
      },
      "typeVersion": 1
    },
    {
      "id": "62b36389-4536-446a-8e05-d1e281c9d3e4",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3248,
        -64
      ],
      "parameters": {
        "color": 4,
        "width": 368,
        "height": 240,
        "content": "## 文件上传过程"
      },
      "typeVersion": 1
    },
    {
      "id": "14de4725-cba3-4fcc-8290-780335b25ac0",
      "name": "便签 11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2736,
        752
      ],
      "parameters": {
        "color": 4,
        "width": 464,
        "height": 208,
        "content": "## 依赖项管理"
      },
      "typeVersion": 1
    },
    {
      "id": "1fdd7c66-15e6-4baa-877a-52c303dfed37",
      "name": "便签15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        656
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "height": 176,
        "content": "## 证书处理"
      },
      "typeVersion": 1
    },
    {
      "id": "db7142fb-a017-4d4f-a849-e31f18a3ced0",
      "name": "便签17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        80
      ],
      "parameters": {
        "color": 4,
        "width": 336,
        "height": 240,
        "content": "## 签名级别选择"
      },
      "typeVersion": 1
    },
    {
      "id": "cae0b264-d552-43e9-b81d-79a667a83597",
      "name": "便签18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        48
      ],
      "parameters": {
        "color": 4,
        "width": 304,
        "height": 256,
        "content": "## 不可见签名"
      },
      "typeVersion": 1
    },
    {
      "id": "47ccb1d2-5591-4163-adf9-294b5227e308",
      "name": "便签19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        752
      ],
      "parameters": {
        "color": 4,
        "width": 304,
        "height": 240,
        "content": "## 可见签名"
      },
      "typeVersion": 1
    },
    {
      "id": "20211c74-84b9-45da-8a50-ced0fb8fff3a",
      "name": "便签 12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        688
      ],
      "parameters": {
        "color": 6,
        "height": 176,
        "content": "## 自定义"
      },
      "typeVersion": 1
    },
    {
      "id": "bc168678-3e5c-4ca7-a28b-80cb0d9ce9f3",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -3392,
        480
      ],
      "webhookId": "dcb6056f-4e05-43e4-864d-27ddc9dbf7eb",
      "parameters": {
        "path": "pdf-sign",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "a5a15088-a7cf-4742-a587-2195acf2c80c",
      "name": "Webhook - LandingPage-LangHU",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -4416,
        640
      ],
      "webhookId": "f523c592-4324-4e0d-838a-19019226fd0e",
      "parameters": {
        "path": "hu/signpage",
        "options": {},
        "responseMode": "responseNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "13d06e50-a167-4e1c-b1a3-6b24cfe964df",
      "name": "响应 Webhook - LandingPage-LangHU",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -4016,
        640
      ],
      "parameters": {
        "options": {
          "responseCode": 200,
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "text/html"
              }
            ]
          }
        },
        "respondWith": "binary"
      },
      "typeVersion": 1.4
    },
    {
      "id": "45c47522-9c43-4cc7-b48a-e35b4c2e9a4f",
      "name": "Webhook - LandingPage-LangEN",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -4416,
        288
      ],
      "webhookId": "f523c592-4324-4e0d-838a-19019226fd0e",
      "parameters": {
        "path": "en/signpage",
        "options": {},
        "responseMode": "responseNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "c70f7ad2-0098-493d-aa55-265a0cc48dda",
      "name": "响应 Webhook - LandingPage-LangEN",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -4016,
        288
      ],
      "parameters": {
        "options": {
          "responseCode": 200,
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "text/html"
              }
            ]
          }
        },
        "respondWith": "binary"
      },
      "typeVersion": 1.4
    },
    {
      "id": "d12a1c28-e84f-486a-a6fe-5b233cc53c45",
      "name": "Webhook - LandingPage-LangDE",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -4416,
        464
      ],
      "webhookId": "f523c592-4324-4e0d-838a-19019226fd0e",
      "parameters": {
        "path": "de/signpage",
        "options": {},
        "responseMode": "responseNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "94650079-2ea5-46fe-ad58-fb922ee29c4f",
      "name": "响应 Webhook - LandingPage-LangDE",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -4016,
        464
      ],
      "parameters": {
        "options": {
          "responseCode": 200,
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "text/html"
              }
            ]
          }
        },
        "respondWith": "binary"
      },
      "typeVersion": 1.4
    },
    {
      "id": "1479b880-69b8-4e44-9163-caa111fd2de1",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4496,
        80
      ],
      "parameters": {
        "color": 4,
        "width": 704,
        "height": 736,
        "content": "## 用于 PDF 签名的着陆页"
      },
      "typeVersion": 1
    },
    {
      "id": "f40cbc91-cf42-4786-9bf1-9c52f93469fe",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4496,
        880
      ],
      "parameters": {
        "width": 704,
        "height": 96,
        "content": "## CURL 示例"
      },
      "typeVersion": 1
    },
    {
      "id": "2b9892b2-90a8-403d-8188-ddfc22c48898",
      "name": "### 需要帮助?",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2800,
        176
      ],
      "parameters": {
        "color": 5,
        "width": 592,
        "height": 96,
        "content": "## 使用 open-pdf-sign 进行 PDF 签名"
      },
      "typeVersion": 1
    },
    {
      "id": "e498cd00-9d6f-452a-a353-97036f01ea2b",
      "name": "## 试试看!",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        368
      ],
      "parameters": {
        "color": 5,
        "width": 704,
        "height": 96,
        "content": "## 使用 Codegic 免费证书测试 PDF 签名"
      },
      "typeVersion": 1
    },
    {
      "id": "d069ac99-abb3-4fba-8609-5880fc4f9900",
      "name": "获取 LandingPage-LangEN",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -4208,
        288
      ],
      "parameters": {
        "url": "https://raw.githubusercontent.com/vighsandor/n8n-externals/main/landingpages-for-pdfsign-workflow/en.html",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "fd6bacf9-c41d-40a1-9d92-1f8d4a8b20b8",
      "name": "获取 LandingPage-LangDE",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -4208,
        464
      ],
      "parameters": {
        "url": "https://raw.githubusercontent.com/vighsandor/n8n-externals/main/landingpages-for-pdfsign-workflow/de.html",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "231c9387-aa6a-4535-9534-3aacb080c641",
      "name": "获取 LandingPage-LangHU",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -4208,
        640
      ],
      "parameters": {
        "url": "https://raw.githubusercontent.com/vighsandor/n8n-externals/main/landingpages-for-pdfsign-workflow/hu.html",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1a47bad6-825d-4253-a99a-9d31f35b5872",
  "connections": {
    "B": {
      "main": [
        [
          {
            "node": "Components",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "T": {
      "main": [
        [
          {
            "node": "Components",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LT": {
      "main": [
        [
          {
            "node": "Components",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LTA": {
      "main": [
        [
          {
            "node": "Components",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get JAR": {
      "main": [
        [
          {
            "node": "Write JAR",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Write Files : PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read PDF": {
      "main": [
        [
          {
            "node": "Write PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read PFX": {
      "main": [
        [
          {
            "node": "Write PFX",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sign PDF": {
      "main": [
        [
          {
            "node": "Read Signed PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write JAR": {
      "main": [
        [
          {
            "node": "Extract Password",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write PDF": {
      "main": [
        [
          {
            "node": "Get Trust Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write PFX": {
      "main": [
        [
          {
            "node": "Get Cert Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Java": {
      "main": [
        [
          {
            "node": "Java Missing?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Components": {
      "main": [
        [
          {
            "node": "Sign PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No Visible": {
      "main": [
        [
          {
            "node": "Switch Sign Visible",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Show Visible": {
      "main": [
        [
          {
            "node": "Switch Sign Visible",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Java Missing?": {
      "main": [
        [
          {
            "node": "Get JAR",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Install Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Cert Script": {
      "main": [
        [
          {
            "node": "Write Cert Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Signed PDF": {
      "main": [
        [
          {
            "node": "Return Signed PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Cert Script": {
      "main": [
        [
          {
            "node": "Get Process Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Password": {
      "main": [
        [
          {
            "node": "Read PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Trust Script": {
      "main": [
        [
          {
            "node": "Write Trust Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Without Visible?": {
      "main": [
        [
          {
            "node": "No Visible",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Show Visible",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Codegic Trust": {
      "main": [
        [
          {
            "node": "Read PFX",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Return Signed PDF": {
      "main": [
        [
          {
            "node": "Get Cleanup Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Cert Script": {
      "main": [
        [
          {
            "node": "Run Cert Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Files : PDF": {
      "main": [
        [
          {
            "node": "Write Files : PFX",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Files : PFX": {
      "main": [
        [
          {
            "node": "Write Files : LOGO",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Cleanup Script": {
      "main": [
        [
          {
            "node": "Write Cleanup Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Install Script": {
      "main": [
        [
          {
            "node": "Write Install Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Process Script": {
      "main": [
        [
          {
            "node": "Write Process Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Files : LOGO": {
      "main": [
        [
          {
            "node": "Check Java",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Trust Script": {
      "main": [
        [
          {
            "node": "Add Codegic Trust",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch Sign Visible": {
      "main": [
        [
          {
            "node": "B",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "T",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "LT",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "LTA",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Install Dependencies": {
      "main": [
        [
          {
            "node": "Get JAR",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Cleanup Script": {
      "main": [
        [
          {
            "node": "Cleanup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Install Script": {
      "main": [
        [
          {
            "node": "Install Dependencies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Process Script": {
      "main": [
        [
          {
            "node": "Without Visible?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get LandingPage-LangDE": {
      "main": [
        [
          {
            "node": "Respond to Webhook - LandingPage-LangDE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get LandingPage-LangEN": {
      "main": [
        [
          {
            "node": "Respond to Webhook - LandingPage-LangEN",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get LandingPage-LangHU": {
      "main": [
        [
          {
            "node": "Respond to Webhook - LandingPage-LangHU",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - LandingPage-LangDE": {
      "main": [
        [
          {
            "node": "Get LandingPage-LangDE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - LandingPage-LangEN": {
      "main": [
        [
          {
            "node": "Get LandingPage-LangEN",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - LandingPage-LangHU": {
      "main": [
        [
          {
            "node": "Get LandingPage-LangHU",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 文档提取

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量65
分类1
节点类型10
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Vigh Sandor

Vigh Sandor

@vighsandor

I'm a DevOps engineer and automation enthusiast who builds smart, practical workflows using n8n.io. I focus on creating reliable, open-source solutions that connect tools and simplify everyday operations — whether it’s infrastructure management, workflow automation, or integrating AI into existing systems.

外部链接
在 n8n.io 查看

分享此工作流