Skip to main content

Remove Header Footer - Excel API

PDF4me Remove Header Footer enables you to remove headers and footers from Excel documents with optional worksheet targeting. This API service processes Excel files and clears text and image headers/footers. The API receives Excel document content through REST API calls, utilizing Base64 encoding for secure transmission. This solution is ideal for document cleanup, template reuse, and automated Excel editing workflows.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog →

Authenticating Your API Request​

Include your API key in the request to authenticate with the PDF4me REST API.

Key Features​

  • Header/Footer Removal: Clear text and image headers and footers
  • Worksheet Targeting: Apply to specific worksheets or all worksheets

REST API Endpoint​

  • Method: POST
  • Endpoint: office/ApiV2Excel/ExcelRemoveHeaderFooter

REST API Parameters​

Important: Parameters marked with an asterisk (*) are required. All requests use document, docContent, and removeHeaderFooterToExcelAction. Operation-specific parameters (worksheetNames, worksheetIndexes, etc.) are properties of the action object.

Required Parameters (root level)​

ParameterRequiredWhat it doesExample
documentRequiredSource file. `Name` must end in `.xlsx`, `.xls` or `.xlsm` (a `.csv` for `ExcelParseCsv`).{ "Name": "data.xlsx" }
document.NameRequiredFile name including its extension. Type: string.{ "Name": "data.xlsx" }
docContentRequiredThe source file, base64-encoded. Type: string.UEsDBBQABgAIAAAA...
isAsyncOptionalProcess the request in the background. The call returns `202 Accepted`; poll the `Location` URL (`GetActionStatus`) for the result. Type: boolean.
removeHeaderFooterToExcelActionRequiredObject carrying this operation's settings. Its fields are the removeHeaderFooterToExcelAction rows below.See Payload example below
removeHeaderFooterToExcelAction.removeHeaderLeftOptionalType: boolean.
removeHeaderFooterToExcelAction.removeHeaderCenterOptionalType: boolean.
removeHeaderFooterToExcelAction.removeHeaderRightOptionalType: boolean.
removeHeaderFooterToExcelAction.removeFooterLeftOptionalType: boolean.
removeHeaderFooterToExcelAction.removeFooterCenterOptionalType: boolean.
removeHeaderFooterToExcelAction.removeFooterRightOptionalType: boolean.
removeHeaderFooterToExcelAction.worksheetNamesOptionalWorksheet names. Type: array.
removeHeaderFooterToExcelAction.worksheetIndexesOptional1-based worksheet numbers. Type: array.

Output​

The API returns the Excel document as a Base64-encoded string in JSON format (document, fileName, success, errorMessage).

Request Example​

Content-Type: application/json
Authorization: Basic YOUR_BASE64_ENCODED_API_KEY

Payload (Basic)​

{
"document": { "Name": "data.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"removeHeaderFooterToExcelAction": {}
}

Payload (With worksheet targeting)​

{
"document": { "Name": "data.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"removeHeaderFooterToExcelAction": {
"worksheetNames": ["Sheet1", "Report"],
"cultureName": "en-US"
}
}

Code Samples​

Get Help​