HTML
JPG
PDF
XML
DOCX
PDF
العمل مع التعليقات التوضيحية في PDF عبر .NET SDK
واجهة برمجة التطبيقات لإدارة التعليقات التوضيحية في مستندات PDF باستخدام .NET.
Get Startedكيفية العمل مع التعليقات التوضيحية في مستندات PDF باستخدام Cloud .NET SDK
للتعامل مع التعليقات التوضيحية في مستندات PDF عبر Cloud .NET SDK ، سنستخدم Aspose.PDF Cloud .NET SDK يتيح لك هذا SDK السحابي بناء تطبيقات إنشاء وتحرير وتحويل PDF قائمة على السحابة بسهولة باستخدام C#، ASP.NET، أو لغات .NET الأخرى لمختلف المنصات السحابية. افتح NuGet مدير الحزم، وابحث عن Aspose.PDF Cloud وقم بالتثبيت. يمكنك أيضاً استخدام الأمر التالي من وحدة تحكم مدير الحزم.
أمر وحدة تحكم مدير الحزم
PM> Install-Package Aspose.Pdf-Cloud
خطوات لإضافة تعليقات توضيحية باستخدام .NET SDK
يمكن لمطوري Aspose.PDF Cloud تحميل وضم التعليقات التوضيحية إلى مستندات PDF بسهولة في بضع سطور من التعليمات البرمجية.
- تحميل ملف PDF.
- إنشاء مربع نص منسق (بما في ذلك الخطوط، الألوان، المحاذاة).
- تقديم التعليق التوضيحي إلى الصفحة المحددة.
- تنزيل المستند المعدل لاستخدامه محليًا.
يوضح رمز العينة هذا إضافة التعليقات التوضيحية إلى مستند PDF
using Aspose.Pdf.Cloud.Sdk.Model;
namespace Annotations
{
public class NewFreetextAnnotation
{
public static async Task Append(AnnotationsHelper helper, string documentName, int pageNumber, string outputName, string remoteFolder)
{
await helper.UploadFile(documentName);
List<FreeTextAnnotation> annotations = new List<FreeTextAnnotation>
{
new FreeTextAnnotation(
Name: "Freetext_NEW_Annotation",
Rect: new Rectangle(100,350, 450,400),
Flags: new List<AnnotationFlags>() { AnnotationFlags.Default },
HorizontalAlignment: HorizontalAlignment.Left,
Intent: FreeTextIntent.FreeTextTypeWriter,
Justification: Justification.Center,
RichText: helper.config.NEW_FT_ANNOTATION_TEXT,
Subject: helper.config.NEW_FT_ANNOTATION_SUBJECT,
Contents: helper.config.NEW_FT_ANNOTATION_CONTENTS,
Title: helper.config.NEW_FT_ANNOTATION_DESCRIPTION,
ZIndex: 1,
TextStyle: new TextStyle(
FontSize: 20,
Font: "Arial",
ForegroundColor: new Color( A: 0xFF, R: 0x00, G: 0xFF, B: 0x00),
BackgroundColor: new Color( A: 0xFF, R: 0xFF, G: 0x00, B: 0x00)
),
Modified: "03/27/2025 00:00:00.000 AM"
)
};
AsposeResponse response = await helper.pdfApi.PostPageFreeTextAnnotationsAsync(documentName, pageNumber, annotations, folder: remoteFolder);
if (response == null)
Console.WriteLine("NewFreetextAnnotation(): Unexpected error!");
else if (response.Code < 200 || response.Code > 299)
Console.WriteLine("NewFreetextAnnotation(): Failed to append text annotation to the document.");
else
{
Console.WriteLine("NewFreetextAnnotation(): annotations '{0}' added to the document '{1}.", helper.config.NEW_FT_ANNOTATION_TEXT, documentName);
await helper.DownloadFile(documentName, outputName, "add_text_annotation_");
}
}
}
}