メインコンテンツへスキップ

テキストヘッダー/フッターを追加 - Excel API

PDF4me テキストヘッダーとフッターを追加 カスタマイズ可能なテキストヘッダーとフッターを追加できます Excel 包括的な書式設定制御を備えたドキュメント。 API サービスプロセス Excel ファイルを開き、フォントスタイル(ファミリー、サイズ、色)、透明度、回転角度、および方向オプション(水平、垂直、斜め、上下逆)を使用して、ヘッダーまたはフッターセクションにテキストを追加します。 API 受け取る Excel ドキュメントコンテンツ REST API 通話を利用して Base64 安全なデータ送信のためのエンコード。このソリューションは、文書のブランディング、ページ番号、日付の表示、プロフェッショナルなプレゼンテーションワークフローに最適です。

関連ブログ記事
この機能に関するブログ記事はまだありません。近日公開予定です。
その間、PDF4me ブログを閲覧して、あらゆるプラットフォームのチュートリアルやワークフローをご覧ください。
ブログをご覧ください →

認証 API リクエスト​

あなたの API 認証リクエストにキーを入力してください PDF4me REST API。

主な機能​

  • カスタムテキストコンテンツ: ヘッダーまたはフッターとして任意のテキストを追加します Excel 文書
  • フォントのカスタマイズフォントの種類、サイズ、色、および特定のフォント名を制御します。
  • 透明性管理テキストを半透明(不透明度50%)または完全不透明(100%)に設定します。
  • 回転と向き回転角度またはプリセットされた向き(水平、垂直、斜め、上下逆)を適用する
  • 文化支援: テキストの適切な表示と書式設定のために、カルチャコードを指定します。

REST API 終点​

  • 方法: POST
  • 終点: office/ApiV2Excel/ExcelAddTextHeaderFooter

REST API パラメータ​

重要: アスタリスク (*) が付いているパラメータは必須です。すべてのリクエストで使用されます。 書類、 ドキュメントコンテンツ、および 1 つのアクション オブジェクト。操作固有のパラメーターは、のプロパティです。 addTextHeaderFooterToExcelAction。

必須パラメータ(ルートレベル)​

パラメータ必須その機能例
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.
addTextHeaderFooterToExcelActionRequiredObject carrying this operation's settings. Its fields are the addTextHeaderFooterToExcelAction rows below.See Payload example below
addTextHeaderFooterToExcelAction.headerLeftOptionalText for the header left section. Type: string.
addTextHeaderFooterToExcelAction.headerCenterOptionalText for the header center section. Type: string.
addTextHeaderFooterToExcelAction.headerRightOptionalText for the header right section. Type: string.
addTextHeaderFooterToExcelAction.footerLeftOptionalText for the footer left section. Type: string.
addTextHeaderFooterToExcelAction.footerCenterOptionalText for the footer center section. Type: string.
addTextHeaderFooterToExcelAction.footerRightOptionalText for the footer right section. Type: string.
addTextHeaderFooterToExcelAction.headerLeftColorOptionalText color. Type: string.
addTextHeaderFooterToExcelAction.headerCenterColorOptionalText color. Type: string.
addTextHeaderFooterToExcelAction.headerRightColorOptionalText color. Type: string.
addTextHeaderFooterToExcelAction.footerLeftColorOptionalText color. Type: string.
addTextHeaderFooterToExcelAction.footerCenterColorOptionalText color. Type: string.
addTextHeaderFooterToExcelAction.footerRightColorOptionalText color. Type: string.
addTextHeaderFooterToExcelAction.headerLeftFontSizeOptionalFont size. Type: integer.
addTextHeaderFooterToExcelAction.headerCenterFontSizeOptionalFont size. Type: integer.
addTextHeaderFooterToExcelAction.headerRightFontSizeOptionalFont size. Type: integer.
addTextHeaderFooterToExcelAction.footerLeftFontSizeOptionalFont size. Type: integer.
addTextHeaderFooterToExcelAction.footerCenterFontSizeOptionalFont size. Type: integer.
addTextHeaderFooterToExcelAction.footerRightFontSizeOptionalFont size. Type: integer.
addTextHeaderFooterToExcelAction.worksheetNamesOptionalComma-separated worksheet names. Type: string.
addTextHeaderFooterToExcelAction.worksheetIndexesOptionalComma-separated 1-based worksheet numbers, e.g. `"1,3"`. Type: string.

出力​

の API 返します Excel ドキュメントとして Base64-エンコードされた文字列 JSON フォーマット。

ステータスコード: 200 OK

応答本文:

{
"document": "UEsDBBQABgAIAAAA...",
"fileName": "data.xlsx",
"success": true,
"errorMessage": null
}

リクエスト例​

ヘッダ​

Content-Type: application/json
Authorization: Basic YOUR_BASE64_ENCODED_API_KEY

ペイロード(基本)​

{
"document": { "Name": "data.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"addTextHeaderFooterToExcelAction": {
"watermarkText": "Confidential Report 2024"
}
}

ペイロード(オプションの書式設定を含む)​

{
"document": { "Name": "data.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"addTextHeaderFooterToExcelAction": {
"watermarkText": "Confidential Report 2024",
"fontFamily": "Arial",
"fontSize": 12,
"fontColor": "#0000FF",
"orientation": "Horizontal"
}
}

コードサンプル​

ヘルプが必要な場合​