HTML JPG PDF XML DOCX
  Product Family
PDF

.NET SDK を介して PDF にフッターを追加

Aspose.PDF Cloud .NET SDK を使用して PDF ドキュメントにフッターを追加するための API

Get Started

.NET でのフッターに関する最も人気のあるアクション

クラウド .NET SDK を使用して PDF ドキュメントでフッターを操作する方法

PDF ドキュメントにフッターを追加するには、 Aspose.PDF Cloud .NET SDK このクラウド SDK は、.NET プログラマーが C#、ASP.NET、またはその他の .NET 言語を使用して、様々なクラウド プラットフォーム向けのクラウドベースの PDF クリエーター、アノテーター、エディター、コンバーター アプリを開発するのを支援します。 またはその他の .NET 言語を使用して、様々なクラウド プラットフォーム向けのクラウドベースの PDF クリエーター、アノテーター、エディター、コンバーター アプリを開発するのを支援します。 NuGet パッケージマネージャーを開き、検索します。 Aspose.PDF Cloud そしてインストールします。パッケージ マネージャー コンソールから以下のコマンドを使用することもできます。

パッケージ マネージャー コンソール コマンド


     
    PM> Install-Package Aspose.Pdf-Cloud
     

.NET を介して PDF のフッターに画像を追加する手順

Aspose.PDF Cloud .NET 開発者は、PDF ドキュメントのフッターに簡単に画像を追加できます。開発者はほんの数行のコードが必要です。

  1. アプリケーションのシークレットとキーを使用して新しい Configuration オブジェクトを作成する
  2. クラウド API に接続するオブジェクトを作成する
  3. ドキュメント ファイルをアップロードする
  4. フッター用のローカル画像ファイルをアップロードする。
  5. フッター設定を準備する。
  6. API を呼び出してフッターを追加する。
  7. 応答を確認し、結果を記録します。
  8. 更新されたファイルをローカルで使用するためにダウンロードします。
 

このサンプルコードは、PDF Cloud .NET SDK を使用して PDF ドキュメントのフッターに画像を追加する方法を示しています


    using Aspose.Pdf.Cloud.Sdk.Api;
    using Aspose.Pdf.Cloud.Sdk.Model;

    namespace Footers
    {
        public class FootersAddImage
        {
            public static async Task Append(string documentName, string outputName, string imageFileName, 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]);
                }

                using (var file = File.OpenRead(Path.Combine(localFolder, imageFileName)))
		{ // Upload the local image file to cloud storage folder name.
                    FilesUploadResult uploadResponse = await pdfApi.UploadFileAsync(Path.Combine(remoteFolder, imageFileName), imageFileName);
                    Console.WriteLine(uploadResponse.Uploaded[0]);
                }

                // Create new Image Footer with input parameters for the PDF on cloud storage.
                ImageFooter footer = new ImageFooter(
                    Background: true,
                    LeftMargin: 1,
                    RightMargin: 2,
                    HorizontalAlignment: HorizontalAlignment.Center,
                    Opacity: 1,
                    Rotate: Rotation.None,
                    RotateAngle: 0,
                    XIndent: 0,
                    YIndent: 0,
                    Zoom: 1,
                    Width: 24,
                    Height: 24,
                    FileName: Path.Combine(remoteFolder, imageFileName)
                );

                // Append new Image Footer in the PDF on cloud storage.
                AsposeResponse response = await pdfApi.PostDocumentImageFooterAsync(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("FootersAddImage(): Failed to append image footer to the document.");
                else
                { // Downloads the updated file for local use.
                    Console.WriteLine("FootersAddImage(): image footer successfully appended to the document '{0}'.", documentName);
                    Stream stream = pdfApi.DownloadFile(Path.Combine(remoteFolder, documentName));
                    using var fileStream = File.Create(Path.Combine(localFolder, "append_image_footer_" + outputName));
                    stream.Position = 0;
                    await stream.CopyToAsync(fileStream);
                    Console.WriteLine("FootersAddImage(): File '{0}' successfully downloaded.", "append_image_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 ドキュメントを最適化します。
  • 機能をテストするために私たちの無料アプリをお試しいただけます。

  •