리스트 스탬프
Contents
[
Hide
]
주석이 달린 PDF로 작업할 때는 기존 러버 스탬프를 수정하거나 제거하기 전에 검사해야 할 수 있습니다.‘get_stamps () ‘메서드를 사용하면 특정 페이지에 있는 모든 스탬프를 검색할 수 있습니다.그런 다음 결과를 반복하여 프로그래밍 방식으로 처리할 수 있습니다.
- 만들기 PDF 콘텐츠 편집기 예.
- 입력 PDF 문서를 바인딩합니다.
- 1페이지에서 모든 스탬프를 검색합니다.
- 스탬프 컬렉션을 반복해서 살펴보세요.
- 각 스탬프를 인쇄합니다.
- 스탬프가 없는 경우 메시지를 표시합니다.
import aspose.pdf.facades as pdf_facades
import aspose.pydrawing as apd
from io import BytesIO
import sys
from os import path
sys.path.append(path.join(path.dirname(__file__), ".."))
from config import set_license, initialize_data_dir
def list_stamps(infile):
# Create PdfContentEditor object
content_editor = pdf_facades.PdfContentEditor()
# Bind document to PdfContentEditor
content_editor.bind_pdf(infile)
# List all stamps on page 1
stamps = content_editor.get_stamps(1)
count = 0
for stamp in stamps:
count += 1
print(f"Stamp {count}: {stamp}")
if count == 0:
print("No stamps found")