Tambahkan Anotasi Popup
Contents
[
Hide
]
Anotasi popup berguna untuk menambahkan komentar, penjelasan, atau catatan interaktif dalam file PDF. Menggunakan PdfContentEditor, Anda dapat membuat anotasi popup secara programatis dengan menentukan lokasi, konten, visibilitas, dan nomor halaman.
- Buat objek PdfContentEditor.
- Hubungkan PDF input.
- Tentukan persegi panjang Popup Annotation.
- Tambahkan Popup Annotation.
- Simpan Document yang diperbarui.
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)