PDF 주석

무료 크로스 플랫폼 앱 및 API를 사용하여 PDF 문서에서 주석 제거

Aspose.PDF 라이브러리를 사용하여 PDF 파일에 주석을 다는 방법

주석은 PDF 파일의 중요한 부분입니다.개발자 친화적인.NET PDF 구성 요소인 Aspose.PDF 는 주석 요구 사항을 충족할 수 있습니다.Aspose.PDF 를 사용하여 새 주석을 추가하고, 기존 주석을 편집하고, 주석을 제거하는 등의 작업을 수행할 수 있습니다. PDF 파일에 주석을 달기 위해 기능이 풍부하고 강력하며 사용하기 쉬운 문서 조작 API인 Aspose.PDF API를 사용합니다.NuGet 패키지 관리자를 열고 Aspose.PDF 를 검색하여 설치합니다.패키지 관리자 콘솔에서 다음 명령을 사용할 수도 있습니다.

문서의 주석 및 메모를 편집하기 위한 하이코드 API

.NET, 자바, C++ 및 안드로이드를 사용하여 PDF 파일에 주석을 달 수 있는 네이티브 API입니다. 텍스트의 내용을 확장하고 다른 사용자를 위해 편집하고 주석을 달기 위해 파일에 추가하는 추가 개체입니다.문서의 텍스트를 더 읽기 쉽게 만들거나, 강조 표시하거나, 밑줄을 긋거나, 완전히 새로운 텍스트를 추가할 수도 있습니다.

C#을 통해 PDF에 캐럿 주석 추가

.NET 라이브러리용 Aspose.PDF 와 함께 C#을 사용하여 캐럿 주석으로 PDF 문서에 주석을 답니다.

캐럿 주석 추가 - C#

// Load the PDF file
Document document = new Document(System.IO.Path.Combine(_dataDir, "sample.pdf"));
// This annotation is used to indicate the insertion of text
var caretAnnotation1 = new CaretAnnotation(document.Pages[1],
    new Rectangle(299.988, 713.664, 308.708, 720.769))
{
    Title = "Aspose User",
    Subject = "Inserted text 1",
    Flags = AnnotationFlags.Print,
    Color = Color.Blue
};
document.Pages[1].Annotations.Add(caretAnnotation1);
document.Save(System.IO.Path.Combine(_dataDir, "sample_caret.pdf"));

Java를 통해 PDF에 원 주석 추가

Java 라이브러리용 Aspose.PDF 와 함께 Java를 사용하여 Circle 주석으로 PDF 문서에 주석을 답니다.

서클 주석 추가 - 자바

// Load the PDF file
Document document = new com.aspose.pdf.Document(_dataDir + "appartments.pdf");
Page page = document.getPages().get_Item(1);

// Create Polygon Annotation
CircleAnnotation circleAnnotation = new CircleAnnotation(page, new Rectangle(270, 160, 483, 383));
circleAnnotation.setTitle("John Smith");
circleAnnotation.setColor(Color.getRed());
circleAnnotation.setInteriorColor(Color.getMistyRose());
circleAnnotation.setOpacity(0.5);
circleAnnotation.setPopup(new PopupAnnotation(page, new Rectangle(842, 316, 1021, 459)));

// Add annotation to the page
page.getAnnotations().add(circleAnnotation);
document.save(_dataDir + "appartments_mod.pdf");

C++를 통해 PDF에 자유 텍스트 주석 추가

C+++용 Aspose.PDF 라이브러리에서 C++를 사용하여 FreeText 주석으로 PDF 문서에 주석을 답니다.

자유 텍스트 주석 추가 - C++

String _dataDir("C:\\Samples\\");

// Load the PDF file
auto document = MakeObject<Document>(_dataDir + u"sample.pdf");
auto page = document->get_Pages()->idx_get(1);

auto defaultAppearance = MakeObject<DefaultAppearance>();
defaultAppearance->set_FontName(u"Helvetica");
defaultAppearance->set_FontSize(12);
defaultAppearance->set_TextColor(System::Drawing::Color::get_Blue());

auto freeTextAnnotation = MakeObject<FreeTextAnnotation>(page, new Rectangle(300.0, 770.0, 400.0, 790.0), defaultAppearance);

freeTextAnnotation->set_RichText(u"Free Text Demo");
page->get_Annotations()->Add(freeTextAnnotation);
document->Save(_dataDir + u"sample_freetext.pdf");