HTML
JPG
PDF
XML
DOCX
PDF
クラウド .NET SDK を使用して PDF のフッターにテキストを追加
Aspose.PDF Cloud .NET SDK を使用して PDF ドキュメントのフッターにテキストを追加するための API
Get Startedクラウド .NET SDK を使用して PDF ドキュメントのフッターにテキストを追加する方法
PDF ドキュメントのフッターにテキストを追加するには、 Aspose.PDF Cloud .NET SDK このクラウド SDK は、.NET プログラマーが C#, ASP.NET を使用してクラウドベースの PDF 作成、注釈、編集、変換アプリを開発するのを支援します。 またはその他の .NET 言語を使用してさまざまなクラウドプラットフォームで。開く NuGet パッケージマネージャーで検索し、 Aspose.PDF Cloud をインストールします。パッケージマネージャーコンソールから次のコマンドを使用することもできます。
パッケージマネージャーコンソールコマンド
PM> Install-Package Aspose.Pdf-Cloud
.NET を介して PDF のフッターにテキストを追加する手順
Aspose.PDF Cloud .NET 開発者は、PDF ドキュメントのフッターに簡単にテキストを追加できます。開発者は数行のコードを必要とします。
- アプリケーションシークレットとキーを使用して新しい Configuration オブジェクトを作成します。
- クラウド API に接続するオブジェクトを作成します。
- ドキュメントファイルをアップロードします。
- フッターを追加するために API を呼び出します。
- レスポンスを確認し、結果を記録します。
- 更新されたファイルをローカルで使用するためにダウンロードします。
このサンプルコードは、PDF Cloud .NET SDK を使用して PDF ドキュメントのフッターにテキストを追加する方法を示しています
using Aspose.Pdf.Cloud.Sdk.Api;
using Aspose.Pdf.Cloud.Sdk.Model;
namespace Footers
{
public class FootersAddText
{
public static async Task Append(string documentName, string outputName, string footerText, int startPage, int endPage, string localFolder, string remoteFolder)
{
// Get your AppSid and AppSecret from https://dashboard.aspose.cloud (free registration required).
pdfApi = new PdfApi(AppSecret, AppSid);
using (var file = File.OpenRead(Path.Combine(localFolder, documentName)))
{ // Upload the local PDF to cloud storage folder name.
FilesUploadResult uploadResponse = await pdfApi.UploadFileAsync(Path.Combine(remoteFolder, documentName), documentName);
Console.WriteLine(uploadResponse.Uploaded[0]);
}
// Create new Text Footer with input parameters for the PDF on cloud storage.
TextFooter footer = new TextFooter(
Background: true,
LeftMargin: 1,
RightMargin: 2,
HorizontalAlignment: HorizontalAlignment.Center,
Opacity: 1,
Rotate: Rotation.None,
RotateAngle: 15,
XIndent: 0,
YIndent: 0,
Zoom: 1,
Value: footerText
);
// Append new Text Footer in the PDF on cloud storage.
AsposeResponse response = await pdfApi.PostDocumentTextFooterAsync(documentName, footer, startPage, endPage, folder: remoteFolder);
// Checks the response and logs the result.
if (response == null)
Console.WriteLine("FootersAddImage(): Unexpected error!");
else if (response.Code < 200 || response.Code > 299)
Console.WriteLine("FootersAddText(): Failed to append text footer to the document.");
else
{ // Downloads the updated file for local use.
Console.WriteLine("FootersAddText(): text footer '{0}' successfully appended to the document '{1}'.", footerText, documentName);
Stream stream = pdfApi.DownloadFile(Path.Combine(remoteFolder, documentName));
using var fileStream = File.Create(Path.Combine(localFolder, "append_text_footer_" + outputName));
stream.Position = 0;
await stream.CopyToAsync(fileStream);
Console.WriteLine("FootersAddText(): File '{0}' successfully downloaded.", "append_text_footer_" + outputName);
}
}
}
}
.NET SDK を介してフッターを処理
PDF のフッターにテキストを追加することは、ドキュメントのブランディング、セキュリティ、美観、および機能を向上させます。特にビジネス文書、レポート、法的書類、マーケティング資料において、プロフェッショナルで構造化されたプレゼンテーションを保証します。 Aspose.PDF Cloud .NET SDK を使用して PDF ドキュメントにフッターを追加します。
私たちの .NET SDK では
- PDF ドキュメントのヘッダーとフッターをテキストまたは画像形式で追加できます。
- PDF ドキュメントにテーブルやテキストまたは画像のスタンプを追加できます。
- 複数の PDF ドキュメントを既存のファイルに追加できます。
- PDF 添付ファイル、注釈、およびフォームフィールドを操作できます。
- PDF ドキュメントに暗号化または復号化を適用し、パスワードを設定できます。
- ページまたは PDF ドキュメント全体からすべてのスタンプとテーブルを削除できます。
- PDF ドキュメントから ID によって特定のスタンプまたはテーブルを削除できます。
- PDF ページ上またはドキュメント全体からテキストの単一または複数のインスタンスを置換できます。
- PDF ドキュメントをさまざまな他のファイル形式に変換するための広範なサポート。
- PDF ファイルのさまざまな要素を抽出し、PDF ドキュメントを最適化します。
- 無料アプリを試して、機能をテストできます。