자유 텍스트 주석 추가
Contents
[
Hide
]
자유 텍스트 주석을 사용하면 팝업 주석 없이 보이는 텍스트를 PDF 페이지에 직접 배치할 수 있습니다.PDFContentEditor를 사용하여 주석 사각형, 표시된 텍스트 및 대상 페이지를 지정할 수 있습니다.
- 생성하기 PDF 콘텐츠 편집기 목적.
- 입력 PDF를 바인딩합니다.
- 주석 위치를 정의합니다.
- 자유 텍스트 주석을 추가합니다.
- 업데이트된 문서를 저장합니다.
import aspose.pdf as ap
import aspose.pdf.facades as pdf_facades
import aspose.pydrawing as apd
import sys
from os import path
sys.path.append(path.join(path.dirname(__file__), ".."))
from config import set_license, initialize_data_dir
def add_free_text_annotation(infile, outfile):
# Create PdfContentEditor object
content_editor = pdf_facades.PdfContentEditor()
# Bind document to PdfContentEditor
content_editor.bind_pdf(infile)
# Add free text annotation to page 1
content_editor.create_free_text(
apd.Rectangle(200, 480, 150, 25), "This is a free text annotation", 1
)
# Save updated document
content_editor.save(outfile)