색인별 스탬프 삭제

Contents
[ ]

페이지에 여러 개의 러버 스탬프가 있는 경우 색인을 사용하여 특정 스탬프를 삭제할 수 있습니다.delete_stamp () 메서드를 사용하면 순서에 따라 주석을 제거할 수 있습니다. 이는 스탬프 ID를 추적하지는 못하지만 순서를 알고 있을 때 유용합니다.

  1. 만들기 PDF 콘텐츠 편집기 예.
  2. 입력 PDF 문서를 바인딩합니다.
  3. bind_pdf (파일 내) 를 사용하여 입력 PDF 파일을 PDF 콘텐츠 편집기 인스턴스에 바인딩합니다.
  4. 페이지 2와 3에서 인덱스 1이 있는 스탬프를 제거하려면 ‘delete_stamp (1, [2, 3]) ‘를 호출합니다.
  5. save (outfile) 를 사용하여 수정된 PDF 문서를 출력 파일에 저장합니다.
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 delete_stamp_by_index(infile, outfile):
    # Create PdfContentEditor object
    content_editor = pdf_facades.PdfContentEditor()
    # Bind document to PdfContentEditor
    content_editor.bind_pdf(infile)
    content_editor.delete_stamp(1, [2, 3])
    # Save updated document
    content_editor.save(outfile)