팝업 주석 추가

Contents
[ ]

팝업 주석은 PDF 파일에 주석, 설명 또는 대화형 메모를 추가하는 데 유용합니다.사용 PDF 콘텐츠 편집기위치, 내용, 가시성 및 페이지 번호를 지정하여 프로그래밍 방식으로 팝업 주석을 만들 수 있습니다.

  1. PDF 컨텐트 편집기 객체를 만듭니다.
  2. 입력 PDF를 바인딩합니다.
  3. 팝업 주석 사각형을 정의합니다.
  4. 팝업 주석을 추가합니다.
  5. 업데이트된 문서를 저장합니다.
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_popup_annotation(infile, outfile):
    # Create PdfContentEditor object
    content_editor = pdf_facades.PdfContentEditor()
    # Bind document to PdfContentEditor
    content_editor.bind_pdf(infile)
    # Add popup annotation to page 1
    content_editor.create_popup(
        apd.Rectangle(220, 520, 180, 80),
        "This is a popup annotation",
        True,
        1,
    )
    # Save updated document
    content_editor.save(outfile)