跳到主要内容

在 Power Automate 中向任何发票 PDF 添加瑞士二维码账单:一个包含 4 个步骤的 Dropbox 工作流程

· 阅读需 20 分钟
SEO and Content Writer

每张瑞士发票都必须包含一个 瑞士二维码钞票 这样,银行和会计软件就可以自动扫描和处理付款。借助 Power Automate 和 PDF4me,这项功能得以实现。 四步流程手动触发,Dropbox 获取文件内容PDF4me 条形码 - 创建 SwissQR 账单Dropbox 创建文件以下屏幕截图展示了画布中捕获的完整运行过程。一份 10 页的发票 /pdf4metest/sample 发票将符合瑞士标准,并附上付款单,然后上传至 /pdf4meoutput 文件名独一无二。10分钟内即可投入生产使用。

流程概览
1. Manually trigger a flow
Manual trigger for testing. Swap for SharePoint When a file is created or any storage trigger in production.
2. Dropbox Get file content
Reads the 10-page invoice from /pdf4metest/sample/10 page.pdf with Infer Content Type Yes.
3. PDF4me Barcode - Create SwissQR Bill
Appends the QR payment slip with CHF, QRR reference, English labels, custom Paging Options to land on page 3.
4. Dropbox Create file
Writes the populated PDF to /pdf4meoutput with a unique guid()+headers/FileName so re-runs do not collide.
简短版

四个 Power Automate 操作。手动触发即可启动流程。Dropbox 获取文件内容 阅读 /pdf4metest/sample/10页.pdf 将“推断内容类型”设置为“是”。PDF4me 条形码 - 创建 SwissQR 账单 附加符合瑞士支付标准的二维码账单页面(输出格式类型) PNG 在本次运行中;切换到 PDF 对于混合输出,IBAN CH4431999123000889012, 数量 5253531, 货币 充血性心力衰竭参考类型 QRR, 语言 英语分离线 用剪刀画线债权人:Var Schneider AG,最终债务人:Pia-Maria Rutschmann-Schnyder,参考号 210000000003139471430009017分页选项 风俗页码 3, 文件名 abc.pdfDropbox 创建文件 写信给 /pdf4me输出 文件名由 guid() + 标头/文件名 为了确保唯一性,输出文件为存档文件夹中可供瑞士银行扫描的文件。

决定你的输出是否符合银行扫描要求的两个因素

首先, IBAN 必须以 CH 或 LI 开头 且最多只能包含 21 个字符。对于 QRR 参考类型,IBAN 必须为 QR-IBAN,而不是标准的IBAN。其次,当 参考类型为 QRR, 这 参考字段是一个 27 位数字字符串,带有一个模 10 校验位。如果没有,请将参考类型切换为 得分 (ISO 11649)或 参考编号留空。银行会拒绝输入错误的参考编号,而不是二维码图像。

它解决了一些常见的现实问题

人们会用类似这样的短语搜索这个问题:

  • “如何在 Power Automate 中自动将瑞士二维码账单添加到我的 PDF 发票中?” 这个 4 步流程就能完成:将 PDF 文件放入 Dropbox,触发流程,带有二维码的账单文件就会出现在输出文件夹中。
  • “Power Automate 能否根据现有发票生成瑞士二维码账单?” 是的,可以通过 PDF4me 的“条形码 - 创建 SwissQR 账单”功能实现。输出结果与之前生成的 PDF 文件相同,只是在首页/末页/指定页面添加了条形码。
  • “我需要二维码库还是瑞士二维码生成器订阅?” 不。PDF4me 操作将二维码生成、模 10 参考数学和完整的瑞士支付标准布局隐藏在一个 Power Automate 步骤中。
  • “如果没有源 PDF 文件,我可以生成独立的二维码吗?” 是的。跳过“高级参数”下的“文件内容”和“文件名”字段;该操作将以所选的输出格式类型(PDF / PNG / JPEG / Tiff)返回独立的二维码账单。
  • “瑞士银行会接受这种输出结果吗?” 此操作会生成符合 ISO 20022 瑞士支付标准的凭证。所有瑞士银行的手机银行应用程序都可以扫描此凭证发起支付。

你正在构建的

这是一个可复用的四步 Power Automate 流程。触发条件生效后,从 Dropbox(或 SharePoint/OneDrive/Outlook)提取源发票,PDF4me 操作添加二维码账单,并将生成的文件以 GUID 前缀命名后上传。此流程同样适用于客户发票、计划批处理或事件驱动的应收账款处理。

Power Automate 流程画布包含四个操作:手动触发流程、Dropbox 获取文件内容、条形码 - 创建 SwissQR 账单、Dropbox 创建文件。

从上到下共四个动作。手动触发便于流程测试;生产中可替换为任何存储触发方式。


你需要什么

  • 动力自动化 账户已开通流量。 打开 Power Automate
  • PDF4me API密钥获取您的 API 密钥首次放置操作时,请登录 PDF4me Connect 连接器。
  • Dropbox 带有源文件夹(例如 /pdf4metest/样本)和一个输出文件夹(/pdf4me输出任何存储方式都适用:SharePoint、OneDrive 或 Dataverse 的映射方式相同。
  • 发票PDF下载10页样本 截图中用来精确地跟随操作。
  • 瑞士支付数据:a CH 或 LI IBAN金额,货币(充血性心力衰竭 或者 欧元),以及债权人和债务人姓名/地址栏。完整字段参考信息请见此处。 行动文件

快速参考:关键参数

Output Format Type
PDF (hybrid), PNG / JPEG / Tiff (standalone images).
IBAN
CH or LI prefix, max 21 chars. QR-IBAN required for QRR references.
Reference Type
QRR (27-digit + mod-10), SCOR (ISO 11649), or NON.
Address Type
S = structured (separate Postal Code + City). K = combined.
Paging Options
first, last, add at end, or custom (uses Page Number). PDF only.
Page Number
1-based page index. Required only when Paging Options is custom.

构建流程

操作 1:手动触发流程

手动触发是最快的测试方法。生产环境中可替换为 Dropbox 创建文件时SharePoint 创建文件时OneDrive 当创建文件时Outlook 当收到新邮件时复发, 或者 网络钩子 取决于您的 AR 流程。

操作 2:Dropbox - 获取文件内容

从输入文件夹中提取源发票。

场地本次运行中使用的值
File/pdf4metest/sample/10 page.pdf
Infer Content TypeYes
Power Automate Dropbox 获取文件内容操作,使用文件 /pdf4metest/sample/10 page.pdf 和高级参数推断内容类型是。

操作 3:PDF4me 条形码 - 创建 SwissQR 账单

搜索 PDF4me 并挑选 条形码 - 创建 SwissQR 账单此操作会在主面板中显示支付字段,并在“高级参数”下显示 4 个字段(分页选项、页码、文件内容、文件名)。配置:

团体场地价值
OutputOutput Format TypePNG
PaymentIBANCH4431999123000889012
PaymentAmount5253531
PaymentCurrencyCHF
PaymentReference TypeQRR
PaymentLanguage TypeEnglish
PaymentSeperator LineLineWithScissor
CreditorCreditor NameVar Schneider AG
CreditorCreditor Address TypeS
CreditorCreditor: Address Line 1Var Schneider AG
CreditorCreditor: Address Line 223
CreditorCreditor PostalCode2501
CreditorCreditor Citybiel
DebtorUltimate Debtor NamePia-Maria Rutschmann-Schnyder
DebtorUltimate Debtor AddressTypeS
DebtorUltimate Debtor: Address Line 1Grosse Marktgasse
DebtorUltimate Debtor: Address Line 233
DebtorUltimate Debtor PostalCode9400
DebtorUltimate Debtor Citybiel
Ref/MsgReference210000000003139471430009017
Ref/MsgUnstructured MessageInstruction of 15.09.2019
Ref/MsgBilling InfoS1/01/20170309/11/10201409/20/14000000/22/36958/30/CH106017086/40/1020/41/3010
Ref/MsgAV1 ParametersName AV1: UV;UltraPay005;12345
Ref/MsgAv2 ParametersName AV2: XY;XYService;54321
AdvancedPaging Optionscustom
AdvancedPage Number3
AdvancedFile ContentFile Content (from Action 2)
AdvancedFile Nameabc.pdf

操作 4:Dropbox - 创建文件

将填充后的文件保存到输出文件夹。使用以下命令生成唯一的文件名。 guid() 这样重播就不会冲突。

场地本次运行中使用的值
Folder Path/pdf4meoutput
File Nameguid() + headers/FileName (concat expression for a unique-per-run name)
File ContentFile Content (from Action 3, dynamic content)
Power Automate Dropbox 创建文件操作,文件夹路径为 /pdf4meoutput,文件名由 guid() + headers/FileName 表达式构建,文件内容为来自 PDF4me 创建 SwissQR 账单操作的动态内容。

guid() 文件名中的表达式可确保每次运行时文件名都唯一。将其放在旁边 标头/文件名 PDF4me 输出的文件名称保留了原始发票名称。

保存并点击 测试瑞士银行可扫描的文件落入…… /pdf4meoutput


故障排除

QR-bill page is blank or unreadable
IBAN is invalid (must start with CH or LI, max 21 chars) or Currency is something other than CHF / EUR. Both are hard requirements of the Swiss Payment Standards.
Bank rejects a QRR reference
QRR references must be 27 digits with a mod-10 check digit. If you do not have one, switch Reference Type to SCOR (ISO 11649) or NON and leave Reference empty.
QR-bill landed on the wrong page
Adjust Paging Options under Advanced. first puts the slip as the new page 1. last appends it after the last page. custom uses Page Number for a specific 1-based position.
Creditor or Debtor address looks wrong on the slip
Mismatched Address Type. With S, fill Postal Code + City and use Address Line 1/2 for street. With K, leave Postal Code + City empty and put the full address into Address Line 1 + Address Line 2.
Create file writes an empty file
File Content on Action 4 is not bound to the PDF4me File Content output. Click the field and re-pick the dynamic content from Action 3.
Want a standalone QR slip without a source invoice
Skip Action 2 (Get file content). On Action 3, leave File Content and File Name empty under Advanced parameters and the action returns a standalone Swiss QR-bill in the chosen Output Format Type.

何时使用这种模式

Outgoing customer invoices
Bills that need to be Swiss-payable directly from a banking app via QR scan.
Subscription billing
QR-IBAN + 27-digit QRR reference identifies the customer or contract on every recurring run.
Bulk invoice retrofitting
When an existing PDF invoice template does not yet carry the payment slip, append it.
e-Bill fallbacks
For customers who prefer paper or in-app QR-scan over electronic Bill.

接下来读什么?


常问问题

Do I need a special Swiss QR library or font?+
No. The PDF4me Create SwissQR Bill action bundles QR-code generation, the QR-bill fonts (Liberation Sans), mod-10 reference math, and the Swiss Payment Standards layout. Configure the fields, save the flow, and the output is a Swiss-compliant file.
What is the difference between QRR, SCOR, and NON references?+
QRR is the Swiss 27-digit numeric reference with a mod-10 check digit; it requires a QR-IBAN. SCOR is the international ISO 11649 creditor reference; it works with a standard IBAN. NON means no reference is shown on the slip, useful for ad-hoc one-off payments where the debtor adds their own reference at payment time.
Can I generate a Swiss QR-bill without an existing PDF invoice?+
Yes. Skip Action 2 (Get file content). On Action 3, leave File Content and File Name empty under Advanced parameters; the action returns a standalone Swiss QR-bill in the chosen Output Format Type (PDF, PNG, JPEG, or Tiff).
My IBAN starts with DE / FR / IT, can I still use this?+
No, Swiss QR-bills are scoped to CH and LI IBANs only. For European SEPA payments with non-Swiss IBANs, use the Generate EPC QR Code for SEPA action instead.
Address Type S vs K, which one should I pick?+
S (Structured) is the modern default: PostalCode and City go in separate fields; Address Line 1/2 carries the street. K (Combined) puts the full address in two free-text Address Line fields and ignores PostalCode/City. New integrations should use S unless you are importing legacy data.
Does the output work with mobile banking apps?+
Yes. Every Swiss bank app that supports payments via QR-bill (every major bank since 2022) can scan the output to pre-fill the payment form. Test by opening UBS, PostFinance, Raiffeisen, or any Swiss banking app and scanning the QR code.
How do I change where the QR-bill page lands?+
Click Show all on Advanced parameters. Set Paging Options to first / last / add at end / custom. For custom, also fill Page Number with the 1-based page index. Only applies when Output Format Type is PDF.
Same scenario in Make, Zapier, or n8n?+
Yes. The same PDF4me Create Swiss QR Bill action is available on all four platforms with identical parameters. See the cross-platform comparison at the bottom of the Create SwissQR Bill action page.

开始使用