8
n8n 中文网amn8n.com

Page2Image:将 PDF 转换为 PNG 工作流(支持多页)

高级

这是一个Building Blocks, IT Ops领域的自动化工作流,包含 25 个节点。主要使用 Set, Html, Limit, Merge, SplitOut 等节点。 使用PDF.co API将PDF转换为PNG(支持多页)

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "59YfV0tNnKG7OHDN",
  "meta": {
    "instanceId": "a9f3b18652ddc96459b459de4fa8fa33252fb820a9e5a1593074f3580352864a",
    "templateCredsSetupCompleted": true
  },
  "name": "Page2Image:将 PDF 转换为 PNG 工作流(支持多页)",
  "tags": [],
  "nodes": [
    {
      "id": "957ca7aa-d8db-4685-8e43-c20ac64f4435",
      "name": "传递二进制数据",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        340
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "1a7ce4da-1335-4fa3-9c85-4408ce385c1b",
      "name": "获取预签名上传 URL (PDF.co)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        880,
        580
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "8a3d12d3-af7e-4e86-8790-2419086b3583",
      "name": "合并二进制和 JSON 数据",
      "type": "n8n-nodes-base.merge",
      "position": [
        1080,
        460
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "03711958-11ec-4d92-b4fe-9ac57ba341c8",
      "name": "将 PDF 上传到预签名 URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1280,
        580
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "54776fcc-ab13-49ef-96db-69cc7fdff0e0",
      "name": "剥离二进制数据",
      "type": "n8n-nodes-base.set",
      "position": [
        1280,
        340
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "9e866bed-a711-4e59-b57c-fae582e0c8ef",
      "name": "合并数据",
      "type": "n8n-nodes-base.merge",
      "position": [
        1480,
        460
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "78ba97cb-ac34-456c-9234-50922301787e",
      "name": "将 PDF 转换为 PNG (PDF.co)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2300,
        580
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "2f9e9568-a73e-40df-b9f8-89b23550b9b3",
      "name": "从 PDF.co 下载 PNG",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2540,
        580
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "61f124ac-c34c-43d3-b517-78e97afb5beb",
      "name": "点击“测试工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -340,
        480
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f71f46dc-4b85-43f1-96de-c660cbd27a35",
      "name": "拆分多页 PDF 文件",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1700,
        460
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "197f2385-a74b-40d5-8064-bf3f95b0a3f0",
      "name": "压缩为 zip 文件",
      "type": "n8n-nodes-base.compression",
      "position": [
        2100,
        360
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "68b14a2d-22b6-4652-bf47-da944f66d212",
      "name": "合并二进制文件",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2760,
        580
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "194c9b65-a729-4cb9-89f5-411ac72c6b13",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        120
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "9a33039c-e3a8-4eef-874a-5ef724195b26",
      "name": "获取示例 PDF 文件",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -140,
        480
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "183a90a2-9f68-47de-ad2a-47f31dcd1a7c",
      "name": "提取 PDF 链接",
      "type": "n8n-nodes-base.html",
      "position": [
        60,
        480
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "a0753106-6a64-4b14-8086-bed9db731670",
      "name": "将链接拆分为项目",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        260,
        480
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "afad6a91-312a-4b5d-9452-94855ed0e369",
      "name": "使用两个相关的 PDF 示例",
      "type": "n8n-nodes-base.limit",
      "position": [
        460,
        480
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8f4f43e1-4dd8-4f40-b498-6b20a7eff155",
      "name": "下载示例 PDF 文件",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        660,
        480
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "739002d5-8cf6-4db6-9056-10616d570b79",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        780
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e7ae005f-9c78-48c7-83cf-2f85d0b75df6",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1620,
        220
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "501a498a-d8e3-4e79-8124-05735ac161af",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1860,
        780
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b048391c-3394-4e07-a600-03b0b5a8d290",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        780
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "f4b5d608-94ea-4dc8-b884-b12da1fe3491",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        700,
        -40
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "766ce5ca-e0bc-442b-b1b5-ada4fe3e9d08",
      "name": "拆分出 URL",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2100,
        580
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6a7a0dfd-71bd-4047-a48a-3bbab131e175",
      "name": "循环遍历 PDF 文件",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1920,
        460
      ],
      "parameters": {},
      "typeVersion": 3
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "822977c6-1c42-4db5-832e-fa39ba3d3571",
  "connections": {
    "Combine data": {
      "main": [
        [
          {
            "node": "Split multipage PDF files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split out urls": {
      "main": [
        [
          {
            "node": "Convert PDF to PNG (PDF.co)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine binaries": {
      "main": [
        [
          {
            "node": "Loop over pdf files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract PDF links": {
      "main": [
        [
          {
            "node": "Split links into items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Strip binary data": {
      "main": [
        [
          {
            "node": "Combine data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop over pdf files": {
      "main": [
        [
          {
            "node": "Compress into zip file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Split out urls",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pass through binary": {
      "main": [
        [
          {
            "node": "Combine binary and json data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GET example PDF files": {
      "main": [
        [
          {
            "node": "Extract PDF links",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split links into items": {
      "main": [
        [
          {
            "node": "Use two relevant PDF examples",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download PNG from PDF.co": {
      "main": [
        [
          {
            "node": "Combine binaries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split multipage PDF files": {
      "main": [
        [
          {
            "node": "Loop over pdf files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download example PDF Files": {
      "main": [
        [
          {
            "node": "Pass through binary",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Presigned Upload URL (PDF.co)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert PDF to PNG (PDF.co)": {
      "main": [
        [
          {
            "node": "Download PNG from PDF.co",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload PDF to Presigned URL": {
      "main": [
        [
          {
            "node": "Combine data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Combine binary and json data": {
      "main": [
        [
          {
            "node": "Upload PDF to Presigned URL",
            "type": "main",
            "index": 0
          },
          {
            "node": "Strip binary data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Use two relevant PDF examples": {
      "main": [
        [
          {
            "node": "Download example PDF Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Presigned Upload URL (PDF.co)": {
      "main": [
        [
          {
            "node": "Combine binary and json data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "GET example PDF files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 构建模块, IT 运维

需要付费吗?

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

工作流信息
难度等级
高级
节点数量25
分类2
节点类型11
难度说明

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

作者
Ludwig

Ludwig

@ludwig

If you have any questions about any of the templates I've built, please reach out to me on LinkedIn (https://www.linkedin.com/in/ludwiggerdes) or via my website down below. 👇

外部链接
在 n8n.io 查看

分享此工作流