HTML JPG PDF XML DOCX
  Product Family
PDF

.NET SDKを使用してPDFからページ注釈を削除

Aspose.PDF Cloud .NET SDKでPDFドキュメントの注釈を削除するAPI。

Get Started

Cloud .NET SDKを使用してPDFドキュメントのページ注釈を削除する方法

PDFドキュメントからページ注釈を削除するために、私たちは Aspose.PDF Cloud .NET SDK このCloud SDKを使用すると、C#、ASP.NET、その他の.NET言語でクラウドベースのPDF作成、編集、変換アプリを簡単に構築できます。開く NuGet パッケージマネージャーで検索 Aspose.PDF Cloud してインストールします。また、パッケージマネージャーコンソールから次のコマンドを使用することもできます。

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


    PM> Install-Package Aspose.Pdf-Cloud
     

.NET SDKを使用して注釈を削除する手順

Aspose.PDF Cloud開発者は、わずか数行のコードでPDFドキュメントに注釈をロードして削除することができます。

  1. 入力PDFをアップロードします。
  2. 指定されたページからすべての注釈を削除します。
  3. エラーを処理し、ステータスを報告します。
  4. クリーンアップされたPDFファイルをダウンロードします。
 

このサンプルコードは、C#を介してPDFドキュメントからページ注釈を削除する方法を示しています


    using Aspose.Pdf.Cloud.Sdk.Model;

    namespace Annotations
    {
        public class DeletePageAnnotations
        {
            public async static Task MakeDeleteAsync(AnnotationsHelper helper, string documentName, int pageNumber, string outputName, string remoteFolder)
            {
                // Delete annotation from the PDF document.
                await helper.UploadFile(documentName);
                AsposeResponse response = await helper.pdfApi.DeletePageAnnotationsAsync(documentName, pageNumber, folder: remoteFolder);
                if (response == null)
                    Console.WriteLine("DeletePageAnnotations(): Unexpected error!");
                else if (response.Code < 200 || response.Code > 299)
                    Console.WriteLine("DeletePageAnnotations(): Failed to delete annotation from the document.");
                else {
                    Console.WriteLine("DeletePageAnnotations(): annotations on page '{0}' deleted from the document '{1}.", pageNumber, documentName);
                    await helper.DownloadFile(documentName, outputName, "del_page_annotations_");
                }
            }
        }
    }