HTML
JPG
PDF
XML
DOCX
PDF
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ドキュメントに注釈をロードして削除することができます。
- 入力PDFをアップロードします。
- 指定されたページからすべての注釈を削除します。
- エラーを処理し、ステータスを報告します。
- クリーンアップされた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_");
}
}
}
}