跳到主要内容

添加图像页眉页脚 ExcelPower Automate

PDF4me 添加图像页眉页脚 Excel 是一个 Power Automate 将徽标、水印或品牌图像插入到……中的操作 Excel 工作表的页眉或页脚部分。无需打开文件,即可在周报上添加公司徽标、用安全图像标记机密文件或为客户交付物添加联合品牌标识。 Excel 手动操作。

此操作的作用

PDF4me 添加图像页眉页脚 Excel 将图像文件映射到工作簿的页眉或页脚,可选择左对齐、居中或右对齐,并可应用于特定工作表或整个文件。图像周围的页面边距可通过“高级参数”以厘米为单位进行配置。

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

我如何验证我的身份 Power Automate 流动?

每一个 PDF4me 行动 Power Automate 需要有效的连接。创建或选择一个包含您数据的连接。 PDF4me API 关键在于流程能够进行身份验证 Excel 安全地处理图像格式化请求。

您不容错过的重要事实

IsHeader 是一个“是/否”下拉菜单,而不是自由文本。
连接器面板将“是否为标题”显示为“是/否”下拉菜单(默认为“是”),将“图像位置”显示为“左/中/右”下拉菜单(默认为“中”)。这两个选项在实时显示中均为下拉菜单。 UI不是布尔字段或自由文本字段。
7 个用于利润率和目标定位的高级参数
高级参数面板显示“显示 5/7”:确认可见上边距、下边距、左边距和右边距(均以厘米为单位),以及此连接器通用的目标字段,包括工作表名称、工作表索引和区域性名称。 Excel 行动。
空白工作表选择器表示所有工作表
如果工作表名称和工作表索引都留空,则图像将在一次运行中应用于工作簿中的每个工作表。
Power Automate PDF4me 添加图像页眉页脚操作已配置,文件内容已映射,文件名已映射为 add_header_sample_file.xlsx,图像内容已映射,图像位置居中,是否为页眉为是,高级参数显示 7 个参数中的 5 个,其中上边距为 5,下边距为 5,左边距为 1.9,右边距为 1.9。

映射文件内容、文件名和图像内容,然后选择图像位置和 IsHeader 放置位置。

参数

必需的: 文件内容、文件名和图像内容。图像位置和是否为页眉均有默认值。页边距和工作表定位是条件性高级参数。

范围必需的它的作用例子
File ContentRequiredBase64 content of the source Excel workbook, mapped from SharePoint, OneDrive, or another prior action.[File Content from Get file content]
File NameRequiredExcel filename including extension (.xlsx or .xls), used for processing and output identification.add_header_sample_file.xlsx
Image ContentRequiredBase64 content of the logo or branding image, mapped from SharePoint, OneDrive, or an email attachment. PNG, JPG, JPEG, or GIF.[File Content from Get file content]
Image PositionOptionalHorizontal alignment within the header/footer zone: Left, Center, or Right. Defaults to Center.Center
IsHeaderOptionalYes places the image in the header, No places it in the footer. Defaults to Yes.Yes
Top MarginConditionalAdvanced parameter. Top page margin in centimeters, controls spacing from the top edge and affects header placement.5
Bottom MarginConditionalAdvanced parameter. Bottom page margin in centimeters, controls spacing from the bottom edge and affects footer placement.5
Left MarginConditionalAdvanced parameter. Left page margin in centimeters, controls overall page layout spacing.1.9
Right MarginConditionalAdvanced parameter. Right page margin in centimeters, controls overall page layout spacing.1.9
Worksheet NamesConditionalAdvanced parameter. List of worksheet names to target. Leave empty along with Worksheet Indexes to apply to every sheet.["Sheet1", "Report"]
Worksheet IndexesConditionalAdvanced parameter. List of 1-based worksheet indexes to target. Combines with Worksheet Names if both are set.[1, 2]
Culture NameConditionalAdvanced parameter. Culture/locale code for processing, for example en-US or de-DE. Blank uses the invariant culture.en-US

笔记: 如果工作表名称和工作表索引均为空或 null,则图像将应用于工作簿中的每个工作表。

输出字段

场地类型它包含什么
documentBase64The Excel workbook with the image header/footer applied.
SuccessBooleantrue if the action completed, false if it failed.
ErrorMessageStringError description, null when Success is true.
ErrorsArrayDetailed error objects, empty when Success is true.

常见错误信息是什么意思?

错误信息原因解决方案
Request is emptyThe request object is null.Provide a valid request object.
Document is emptyFile Content is null or empty.Provide a valid Excel document in File Content.
Image content is emptyImage Content is null or empty.Provide valid image content from a prior action.
Invalid worksheet selectionWorksheet names or indexes don't exist or are out of range.Use existing worksheet names or valid 1-based indexes.
Available worksheets in workbook (X total)Informational message shown when worksheet selection validation fails.Review worksheet names/indexes and use a valid value from the X available worksheets.

如何在网页上设置添加图片页眉页脚? Power Automate

  1. 添加 PDF4meExcel - 添加图像页眉页脚 致你 Power Automate 流动。
  2. 地图 文件内容文件名 来自之前的操作(SharePointOneDrive,或获取文件内容)。
  3. 地图 图片内容 来自徽标、水印或品牌图像文件。
  4. IsHeader是的 标题或 选择页脚。 图像位置左边中心, 或者 正确的
  5. 扩张 高级参数 设置 顶部底部左边, 和 右边距或针对特定目标 工作表名称/工作表索引运行流程后,品牌工作簿将返回。 文档

典型配置

工作流程示例Common Power Automate flow patterns using Add Image Header Footer.
周报标志品牌
  1. 预定流程会在每周一早上触发。
  2. 获取文件内容,从中检索每周绩效报告。 SharePoint
  3. 添加图像页眉页脚,插入公司徽标,IsHeader 为 Yes,图像位置居中,工作表名称和工作表索引留空,以覆盖每个工作表。
  4. 这份带有品牌标识的报告将通过电子邮件发送给管理层并存档。
机密水印页脚
  1. 当敏感信号触发时,流量就会被触发。 Excel 文件落入受限区域。 SharePoint 文件夹。
  2. 获取文件内容会检索工作簿,并从资产中获取“机密”印章图像。
  3. 添加图像页眉页脚设置 IsHeader 为 No,图像位置居中,仅针对工作表名称 ["Sheet1", "Summary"]。
  4. 盖章后的文件只会通过电子邮件发送给授权的审阅者。
客户联合品牌交付物
  1. 当项目交付成果被标记为“最终版”时,流程就会触发。
  2. 添加图像页眉页脚插入公司内部徽标,图像位置为右,是否为页眉为是。
  3. 第二次调用“添加图像页眉页脚”会将客户的徽标插入到同一工作表中,图像位置为左侧。
  4. 双品牌工作手册已发送给客户利益相关者。

实用技巧

IsHeader and footer share the same margin controls
Top and Bottom Margin affect header and footer placement respectively regardless of the IsHeader setting, so adjust both if you plan to add separate header and footer images in sequence.
Chain two calls for both header and footer
One action call places the image in either the header or the footer, not both. Chain two Add Image Header Footer actions, one with IsHeader Yes and one with IsHeader No, to brand both zones in a single flow.
Worksheet Names and Indexes combine, not replace
If you set values in both Worksheet Names and Worksheet Indexes, the action processes the union of both lists, so a name typo will not silently exclude a sheet if its index is also listed.
Test margin values on a copy first
Margins that are too small can cause the image to overlap the first row of data. Test with representative worksheet content before deploying to a production report.
Branch on Success before continuing
Add a Condition on Success after this action so a failed image insertion does not pass a partially branded workbook further down the flow.

速查表

场地价值
ActionExcel - Add Image Header Footer
Required fieldsFile Content, File Name, Image Content
Placement fieldsImage Position (Left/Center/Right, default Center), IsHeader (Yes/No, default Yes)
Advanced parameters7 total: Top/Bottom/Left/Right Margin (cm), Worksheet Names, Worksheet Indexes, Culture Name
Outputdocument (Base64 workbook) + Success + ErrorMessage + Errors

常见问题

How do I add a logo image to an Excel header in Power Automate?+
Add the PDF4me Add Image Header Footer action, map the workbook into File Content and the logo file into Image Content, set IsHeader to Yes, and choose an Image Position of Left, Center, or Right. Leave Worksheet Names and Worksheet Indexes empty to apply the logo to every sheet.
Can I place the image in the footer instead of the header?+
Yes. Set IsHeader to No to place the image in the footer section instead. The same Image Position and margin controls apply to both header and footer placement.
Can I add the image to only specific worksheets?+
Yes. Expand Advanced parameters and list Worksheet Names or Worksheet Indexes for the sheets to target. Leaving both empty applies the image to every worksheet in the workbook. See Microsoft's guide to <a href="https://support.microsoft.com/en-us/office/add-a-watermark-in-excel-a372182a-d733-484e-825c-18ddf3edf009" target="_blank" rel="noopener noreferrer">adding images to Excel worksheets</a> for how Excel scopes header/footer content per sheet.
What image formats does this action accept?+
The action accepts PNG, JPG, JPEG, and GIF image content mapped from a prior Get file content step, SharePoint, OneDrive, or an email attachment.
What do the margin parameters control?+
Top, Bottom, Left, and Right Margin, each in centimeters, are advanced parameters that control the page margins around the header/footer area, which affects how much space the inserted image has before it overlaps worksheet content. See <a href="https://www.ablebits.com/office-addins-blog/excel-header-footer-add-change-remove/" target="_blank" rel="noopener noreferrer">Ablebits' guide to Excel headers and footers</a> for how page margins interact with header/footer sizing.

行业应用案例及应用

  • 财务报表在季度报告中添加公司徽标标题
  • 审计文件在页脚添加审计公司标志水印
  • 费用报告:在费用报销单上添加公司标志页眉

相关操作

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

获取帮助