HTML JPG PDF XML DOCX
  Product Family
PDF

استبدال التعليقات التوضيحية النصية في PDF عبر Go SDK

API لاستبدال التعليقات التوضيحية في مستندات PDF باستخدام Aspose.PDF Cloud Go SDK

Get Started

كيفية استبدال التعليقات التوضيحية النصية في مستندات PDF باستخدام Cloud Go SDK

لاستبدال التعليقات التوضيحية في مستندات PDF، سنستخدم Aspose.PDF Cloud Go SDK يساعد هذا SDK السحابي مبرمجي Go في تطوير تطبيقات لإنشاء وتحرير وتعديل وتحويل ملفات PDF المعتمدة على السحابة باستخدام لغة البرمجة Go عبر Aspose.PDF REST API. استخدم الأمر التالي من وحدة إدارة الحزم.

أمر وحدة إدارة الحزم


     
    go get -u github.com/aspose-pdf-cloud/aspose-pdf-cloud-go/v25
     
     

خطوات استبدال التعليقات التوضيحية باستخدام Go

يمكن لمطوري Aspose.PDF Cloud Go بسهولة استبدال التعليقات التوضيحية في مستندات PDF. يحتاج المطورون إلى بضعة أسطر من التعليمات البرمجية فقط.

  1. تحميل الملف إلى التخزين السحابي.
  2. تقوم getAnnotation بجلب تعليق توضيحي نصي حسب معرفه من ملف PDF مخزن في السحابة.
  3. تقوم ModifyAnnotation بتحديث محتويات وأيقونة ذلك التعليق التوضيحي.
  4. بعد التعديل، يتم تنزيل ملف PDF المحدث محليًا.
 

يعرض هذا الكود المثال استبدال التعليقات التوضيحية النصية في مستند PDF باستخدام PDF Cloud Go SDK


    package main

    import (
        "fmt"

        asposepdfcloud "github.com/aspose-pdf-cloud/aspose-pdf-cloud-go/v25"
    )

    func getAnnotation(pdf_api *asposepdfcloud.PdfApiService, document_name string, annotation_id string, remote_folder string) *asposepdfcloud.TextAnnotation {
        // Get annotation by Id in the PDF document.
        args := map[string]interface{}{
            "folder": remote_folder,
        }
        result, httpResponse, err := pdf_api.GetTextAnnotation(document_name, annotation_id, args)
        if err != nil {
            fmt.Println(err.Error())
            return nil
        } else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
            fmt.Println("getAnnotation(): Failed to get annotation in the document.")
            return nil
        } else {
            fmt.Println("getAnnotation(): nnotation '" + annotation_id + "' successfully found '" + result.Annotation.Contents + "' in the document '" + document_name + "'.")
            return result.Annotation
        }
    }

    func ModifyAnnotation(pdf_api *asposepdfcloud.PdfApiService, document_name string, output_document string, annotation_id string, remote_folder string) {
        // Change annotation by Id in the PDF document.
        UploadFile(pdf_api, document_name)
        args := map[string]interface{}{
            "folder": remote_folder,
        }
        annotation := getAnnotation(pdf_api, document_name, annotation_id, remote_folder)
        annotation.Contents = REPLACED_CONTENT
        annotation.Icon = asposepdfcloud.TextIconStar

        _, httpResponse, err := pdf_api.PutTextAnnotation(document_name, annotation_id, *annotation, args)
        if err != nil {
            fmt.Println(err.Error())
        } else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
            fmt.Println("ModifyAnnotation(): Failed to modify annotation in the document.")
        } else {
            fmt.Println("ModifyAnnotation(): annotation '" + annotation.Id + "' successfully modified in the document '" + document_name + "'.")
            DownloadFile(pdf_api, document_name, output_document, "replaced_annotatiom_")
        }
    }
 

مع SDK الخاص بنا لـ Go يمكنك

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

  •