إنشاء ختم مطاطي مع ملف المظهر

Contents
[ ]

يمكن تخصيص التعليقات التوضيحية للختم المطاطي ليس فقط بالنص ولكن أيضًا باستخدام ملف صورة كمظهر لها. هذا الأسلوب مفيد لإضافة شعارات الشركة أو طوابع التوقيع أو أي مؤشر مرئي إلى صفحات PDF الخاصة بك.

  1. قم بإنشاء محرر محتوى PDF مثال.
  2. قم بربط وثيقة PDF المدخلة.
  3. حدد مستطيلًا للختم.
  4. استخدم ملف صورة مخصص لتحديد مظهر الختم المطاطي.
  5. قم بتعيين نص ولون الطابع.
  6. احفظ مستند 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 create_rubber_stamp_with_appearance_file(infile, image_file, outfile):
    # Create PdfContentEditor object
    content_editor = pdf_facades.PdfContentEditor()
    # Bind document to PdfContentEditor
    content_editor.bind_pdf(infile)
    # Create rubber stamp using appearance_file overload (image path)
    content_editor.create_rubber_stamp(
        1,
        apd.Rectangle(100, 400, 200, 60),
        "Stamp with custom appearance",
        apd.Color.dark_green,
        image_file,
    )
    # Save updated document
    content_editor.save(outfile)