跳到主要内容

添加条形码 PDFMake

本模块的功能

PDF4me添加条形码 PDF 插入条形码或 QR 在现有文档的特定页面上的精确位置编写代码 PDF 并返回一个嵌入条形码的新文档。有六种格式可供选择。 QR CodeData MatrixCode128AztecHanXin, 和 PDF417并使用对齐锚点和边距偏移,以毫米级的精度定位条形码。每一份经过您处理的文件都将如此。 Make 场景会自动生成条形码,无需手动编辑。

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

验证您的身份 API 要求

每一个 PDF4me 模块 Make 需要有效 联系创建或选择一个可以容纳您的 PDF4me API 关键在于确保该方案能够安全地验证条形码插入请求。

您不容错过的重要事实

两个对准轴都需要
模块中“垂直对齐”和“水平对齐”均标记为必填项。您必须同时设置这两项,它们会将条形码锚定到页面的某个角或边缘。然后,边距字段会根据您指定的毫米数,将条形码从该锚点向内推移。
高度和宽度均不得超过1000毫米
模块提示明确指出,两个尺寸都必须小于或等于 1000 毫米。对于标准 A4 纸张(210 x 297 毫米),请确保两个尺寸均小于此值,否则条形码会超出页面边界。这些字段为可选字段,如果留空,模块将使用默认尺寸。
隐藏文本仅适用于 Code 128
模块中的提示文本内容如下:“隐藏条形码下方的文本。仅适用于 Code 128。“ 为了 QR CodeDataMatrixAztecPDF417, 和 HanXin 这个开关不起作用,这些格式下面没有人类可读的文本行。
使用 PDF4me 的“向 PDF 添加条形码”模块,连接设置为 TestUser01,文件设置为“映射”,文件名和 PDF 文档字段已映射自步骤 1,条形码类型设置为 QR 码,条形码文本显示 ORDER-2024-00123,高度 50 毫米,宽度 50 毫米,页面设置为“全部”,垂直对齐方式为“底部”,水平对齐方式为“右”,水平边距 10,垂直边距 15,透明度 1,隐藏文本设置为“否”。

文件已设置为 Map 传递文件名和 PDF 可从任何先前模块获取二进制数据。条形码类型、条形码文本、页码、垂直对齐方式和水平对齐方式均为必填字段。

参数

必需的: 连接,文件(文件名 + PDF 使用文档时 Map)、条形码类型、条形码文本、页面、垂直对齐方式和水平对齐方式,所有这些参数都必须提供,模块才能运行。

范围必需的它的作用例子
ConnectionYesPDF4me API connection. Click Add and paste your API key if connecting for the first time.Your PDF4me connection
FileYesSource PDF. Choose Dropbox - Download a File for a direct Dropbox trigger, or Map to supply filename and binary from a prior module.Map
File NameYes (when Map)Original filename of the source PDF including .pdf extension. Map from the prior module's file name output.1. File Name
PDF DocumentYes (when Map)Binary content of the source PDF. Map from the prior module's data output.1. Data
Barcode TypeYesFormat of the barcode to insert. Options: QR Code, Data Matrix, Code128, Aztec, HanXin, PDF417.QR Code
Barcode TextYesThe data to encode inside the barcode: an order ID, URL, asset number, or any alphanumeric string.ORDER-2024-00123
Barcode Height in mmNoVertical size of the barcode in millimeters. Must be 1000 or less. Default is 50.50
Barcode Width in mmNoHorizontal size of the barcode in millimeters. Must be 1000 or less. Default is 50.50
PagesYesPages where the barcode is added. Enter all for every page, a single number, or a comma-separated list.all
Vertical AlignmentYesVertical anchor point on the page: Top, Middle, or Bottom. Combined with Vertical Margin for exact placement.Bottom
Horizontal AlignmentYesHorizontal anchor point on the page: Left, Center, or Right. Combined with Horizontal Margin for exact placement.Right
Horizontal Margin in mmNoDistance in mm the barcode is offset inward from the Horizontal Alignment edge. Default is 10.10
Vertical Margin in mmNoDistance in mm the barcode is offset inward from the Vertical Alignment edge. Default is 15.15
TransparencyNoOpacity of the barcode. 0 = fully transparent, 1 = fully opaque. Must be 1 or less. Default is 1.1
Hide TextNoControls whether human-readable text appears below the barcode. Applies only to Code 128. Options: Yes, No, Empty.No

快速设置

  1. 添加 PDF4me -> 添加条形码 PDF 致你 Make 设想。
  2. 选择 联系 (或点击) 添加 用你的 API 钥匙)。
  3. 文件 到 Dropbox - 下载文件或 Map:如果使用 Map, 连接 文件名PDF 文档 从上一步开始。
  4. 选择 条形码类型 然后进入 条形码文本 进行编码。
  5. 全部页码或指定单个页码。
  6. 选择 垂直对齐水平对齐, 然后 节省 并运行该场景。输出结果包含 Document NameDoc Data: 这 PDF 嵌入条形码。

工作流程示例

工作流程示例Common Make scenario patterns using Add Barcode to PDF.
添加订单跟踪 QR codes 发票
  1. 当有新发票时,Dropbox 会触发。 PDF 文件会保存在“发票”文件夹中。
  2. 添加条形码 PDF 运行时条形码类型设置为 QR Code条形码文本映射自订单 ID,页面设置为全部,垂直对齐方式为底部,水平对齐方式为右侧。
  3. 返回 PDF 已上传至 Dropbox 中的“已处理发票”文件夹。
  4. Slack 通知调度团队,条形码发票已准备好进行扫描。
在设备记录上盖章资产标签
  1. 在 Google 表格(资产登记表)中添加新行会触发此场景。
  2. Google 云端硬盘下载空白资产记录 PDF 模板。
  3. 添加条形码 PDF 插入一个 Code128 第 1 页左上角带有资产 ID 的条形码。
  4. 条形码 PDF 已上传至 SharePoint 在对应的部门文件夹中。
每月存档快照,包含合同参考条形码
  1. 每月1日会触发一个预定事件。
  2. Google 云端硬盘下载有效合约 PDF
  3. 添加条形码 PDF 插入一个 DataMatrix 条形码(紧凑、高密度),合同参考编号位于右下角。
  4. 条形码快照会保存到“存档”文件夹中。每个存档版本都包含一个可扫描的参考信息,该信息链接回源记录。

常见问题解答

What barcode formats does this module support?+
Six formats: QR Code, Data Matrix, Code128, Aztec, HanXin (Chinese national standard 2D code), and PDF417. Select the format from the Barcode Type dropdown. QR Code suits links and general data; Code128 is widely used for linear shipping and retail barcodes; DataMatrix is compact enough for small labels.
How do Vertical Alignment and Horizontal Alignment work together?+
The two alignment fields act as an anchor. Setting Vertical Alignment to Bottom and Horizontal Alignment to Right anchors the barcode to the bottom-right corner of the page. The Vertical Margin and Horizontal Margin fields then push it inward from that corner by the number of millimeters you enter: so Horizontal Margin 10 and Vertical Margin 15 places it 10mm from the right edge and 15mm up from the bottom.
What does the Pages field accept?+
The field accepts all to stamp every page, a single page number, or a comma-separated list of page numbers. The module hint reads "Pages in which barcode needs to be added." Using all is the most common choice for document-level stamps like tracking codes.
Does Hide Text work for all barcode types?+
No. The module hint states explicitly: "Hides text below barcode. Applicable only for Code 128." For QR Code, Data Matrix, Aztec, PDF417, and HanXin the field has no effect because those formats do not display a human-readable text line.
Is the original source PDF modified?+
No. PDF4me processes a copy and returns a new document in the Doc Data output field. Your source file in Dropbox, Google Drive, or any other location is completely untouched.

相关模块

获取帮助