C# 를 사용하여 PDF의 주석을 관리하세요

API를 사용하여 PDF 주석을 관리하기 위한 최신 C# 라이브러리입니다.

.NET 라이브러리를 사용하여 주석을 관리하는 방법

PDF 파일에 텍스트 주석을 추가하기 위해 net 플랫폼을 위한 기능이 풍부하고 강력하며 사용하기 쉬운 문서 조작 API인 Aspose.PDF for .NET API를 사용할 것입니다.NuGet 패키지 관리자를 열고 Aspose.pdf를 검색하여 설치합니다.패키지 관리자 콘솔에서 다음 명령을 사용할 수도 있습니다.

Package Manager Console

PM > Install-Package Aspose.PDF

C# 를 통해 PDF 문서에 주석 만들기


사용자 환경에서 코드를 테스트하려면 Aspose.PDF for.NET용 이 필요합니다.

1.문서 클래스의 인스턴스에서 PDF를 로드합니다. 1.PDF에 추가할 주석을 생성합니다. 1.페이지 객체의 주석 컬렉션에 주석을 추가합니다. 1.PDF 파일을 저장합니다.

PDF 텍스트 주석 - C#

Example: C#


    Document pdfDocument = new Document(dataDir + "AddAnnotation.pdf");
    TextAnnotation textAnnotation = new TextAnnotation(pdfDocument.Pages[1], new Aspose.Pdf.Rectangle(200, 400, 400, 600));
    textAnnotation.Title = "Sample Annotation Title";
    textAnnotation.Subject = "Sample Subject";
    textAnnotation.State = AnnotationState.Accepted;
    textAnnotation.Contents = "Sample contents for the annotation";
    textAnnotation.Open = true;
    textAnnotation.Icon = TextIcon.Key;
    Border border = new Border(textAnnotation);
    border.Width = 5;
    border.Dash = new Dash(1, 1);
    textAnnotation.Border = border;
    textAnnotation.Rect = new Aspose.Pdf.Rectangle(200, 400, 400, 600);
    pdfDocument.Pages[1].Annotations.Add(textAnnotation);
    dataDir = dataDir + "AddAnnotation_out.pdf";
    pdfDocument.Save(dataDir);