HTML JPG PDF XML DOCX
  Product Family
PDF

Xóa Chú Thích Văn Bản từ PDF qua .NET SDK

API để loại bỏ chú thích vào tài liệu PDF với Aspose.PDF Cloud .NET SDK.

Get Started

Cách xóa chú thích Văn bản từ tài liệu PDF sử dụng Cloud .NET SDK

Để loại bỏ chú thích văn bản từ tài liệu PDF, chúng ta sẽ sử dụng Aspose.PDF Cloud .NET SDK Cloud SDK này cho phép bạn dễ dàng xây dựng các ứng dụng tạo, chỉnh sửa & chuyển đổi PDF trên đám mây bằng C#, ASP.NET, hoặc các ngôn ngữ .NET khác cho các nền tảng đám mây khác nhau. Mở NuGet trình quản lý gói, tìm kiếm Aspose.PDF Cloud và cài đặt. Bạn cũng có thể sử dụng lệnh sau từ Bảng điều khiển Trình quản lý Gói.

Lệnh Bảng điều khiển Trình quản lý Gói


    PM> Install-Package Aspose.Pdf-Cloud
     

Các bước để loại bỏ chú thích sử dụng .NET SDK

Các nhà phát triển Aspose.PDF Cloud có thể dễ dàng tải và xóa chú thích vào tài liệu PDF chỉ với vài dòng mã.

  1. Tải tài liệu lên đám mây.
  2. Xóa một chú thích cụ thể bằng DeleteTextAnnotation().
  3. Xử lý phản hồi để đảm bảo thành công.
  4. Loại bỏ bất kỳ chú thích popup liên quan.
  5. Tải xuống tài liệu đã cập nhật.
 

Mã mẫu này cho thấy cách xóa Chú Thích Văn Bản từ tài liệu PDF qua C#


    using Aspose.Pdf.Cloud.Sdk.Model;

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