IRONSOFTWAREHOME
주석

import com.ironsoftware.ironpdf.PdfDocument;
import com.ironsoftware.ironpdf.annotation.AnnotationIcon;
import com.ironsoftware.ironpdf.annotation.AnnotationManager;
import com.ironsoftware.ironpdf.annotation.AnnotationOptions;
import java.io.IOException;
import java.nio.file.Paths;

// Create a new PDF or load an existing one from the filesystem
PdfDocument pdf = PdfDocument.fromFile(Paths.get("assets/example.pdf"));

// Create an annotation to be placed at a specific location on a page.
AnnotationOptions annotation = new AnnotationOptions(
        "This is a major title", // Title of the annotation
        "This is the long 'sticky note' comment content...", // Content of the annotation
        150, // x-axis coordinate location
        250  // y-axis coordinate location
);
annotation.setIcon(AnnotationIcon.HELP);
annotation.setOpacity(0.9);
annotation.setPrintable(false);
annotation.setHidden(false);
annotation.setOpen(true);
annotation.setReadonly(true);
annotation.setRotateable(true);

// Add the annotation to a specific page of the PDF
AnnotationManager annotationManager = pdf.getAnnotation();
annotationManager.addTextAnnotation(annotation, 0);

// Save the PDF with the modifications
pdf.saveAs(Paths.get("assets/annotated.pdf"));
mvn install
주석

주석

지정된 PDF 문서 페이지에 "포스트잇" 스타일 주석을 추가하기 위해 IronPDF의 IronPdf 클래스와 함께 PdfDocument 객체의 AnnotationManager을 사용하세요.

아래 코드 예시에서 보인 것처럼, AnnotationOptions 생성자에서 인수로 텍스트와 데카르트 (x, y) 좌표를 지정하여 페이지의 주어진 위치에 텍스트 기반 주석을 만드세요. 다음으로, 작업 중인 PDF 문서의 원하는 페이지에 주석을 추가하기 위해 AnnotationManager에서 addTextAnnotation 메서드를 호출하세요.

모든 AnnotationOptions 객체에 있는 추가 메서드를 통해 개발자는 주석의 외관과 동작을 사용자 정의할 수 있습니다. 아래의 코드 예시에서 우리는 그 setOpacity()setFeaturedIcon()을 설정하고, 편집할 수 없고 인쇄할 수 없도록 구성합니다. 개발자는 주석의 색상, 높이, 제목뿐만 아니라 제목, 주제, 내용 및 위치도 변경할 수 있습니다.

Java를 사용하여 PDF에 주석을 추가하는 단계

  1. PDF 문서에 주석을 추가하려면 IronPdf Java 라이브러리를 설치하세요.
  2. Java에서 기존 PDF 파일을 로드하기 위해 PdfDocument 클래스를 활용하세요.
  3. AnnotationOptions 클래스를 사용하여 주석을 생성하고 사용자 정의하세요.
  4. PDF의 특정 페이지에 주석을 추가하기 위해 IronPDF의 addTextAnnotation을 사용하세요.
  5. 주석이 포함된 PDF 문서를 내보냅니다.

IronPDF 사용하여 PDF에 주석을 추가하는 방법에 대한 자세한 내용은 IronPDF 설명서를 참조하십시오.

Explore AnnotationOptions in IronPDF Java Docs AnnotationOptions

GitHub에서 보기

시작할 준비 되셨나요?

버전:2026.6방금 출시

Key in blue circle

무료 30일 체험 키를 즉시 받으세요.

Your trial license will be sent to your email address

제한 없음. 100% 무제한 이용. 신용카드 불필요.

bullet_checked신용카드나 계정 생성은 필요하지 않습니다.제한 없음. 100% 무제한 이용. 신용카드 불필요.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
무료 라이브 데모를 예약하세요
Booking Badge

전 세계 수백만 엔지니어들이 신뢰하는 제품입니다.

Iron Software의 고객 로고
부담 없는 무료 상담을 받아보세요
아래 양식을 작성하시거나 sales@ironsoftware.com으로 이메일을 보내주세요.
고객님의 정보는 항상 비밀로 유지됩니다.
전 세계 수백만 엔지니어들이 신뢰하는 제품입니다.
Iron Software의 고객 로고
지금 바로 30일 무료 체험판 키를 받으세요.
신용카드나 계정 생성은 필요하지 않습니다.