BarcodeParameters
محتويات
[
يخفي
]BarcodeParameters class
فئة الحاوية لمعلمات الباركود التي سيتم تمريرها إلى BarcodeGenerator.
لمعرفة المزيد، قم بزيارةالعمل مع الحقول مقالة توثيقية.
public class BarcodeParameters
المنشئون
اسم | وصف |
---|---|
BarcodeParameters() | Default_Constructor |
الخصائص
اسم | وصف |
---|---|
AddStartStopChar { get; set; } | ما إذا كان سيتم إضافة أحرف البدء/الإيقاف لأنواع الباركود NW7 وCODE39. |
BackgroundColor { get; set; } | لون خلفية الرمز الشريطي (0x000000 - 0xFFFFFF) |
BarcodeType { get; set; } | نوع الرمز الشريطي. |
BarcodeValue { get; set; } | البيانات المراد ترميزها. |
CaseCodeStyle { get; set; } | نمط رمز الحالة لنوع الباركود ITF14. القيم الصحيحة هي [STD|EXT|ADD] |
DisplayText { get; set; } | ما إذا كان سيتم عرض بيانات الباركود (النص) مع الصورة. |
ErrorCorrectionLevel { get; set; } | مستوى تصحيح خطأ رمز الاستجابة السريعة (QR Code) هو [0، 3]. |
FacingIdentificationMark { get; set; } | نوع علامة التعريف المواجهة (FIM). |
FixCheckDigit { get; set; } | ما إذا كان سيتم إصلاح رقم الفحص إذا كان غير صالح. |
ForegroundColor { get; set; } | لون مقدمة الرمز الشريطي (0x000000 - 0xFFFFFF) |
IsBookmark { get; set; } | سواءPostalAddress هو اسم الإشارة المرجعية. |
IsUSPostalAddress { get; set; } | سواءPostalAddress هو عنوان بريدي أمريكي. |
PosCodeStyle { get; set; } | نمط رمز نقطة البيع (أنواع الباركود: UPCA|UPCE|EAN13|EAN8). القيم الصحيحة (غير حساسة لحالة الأحرف) هي [STD|SUP2|SUP5|CASE]. |
PostalAddress { get; set; } | عنوان البريد الإلكتروني بالباركود. |
ScalingFactor { get; set; } | معامل القياس للرمز. القيمة بنقاط مئوية صحيحة، والقيم الصحيحة هي [10، 1000]. |
SymbolHeight { get; set; } | ارتفاع صورة الرمز الشريطي (بالتويب - 1/1440 بوصة) |
SymbolRotation { get; set; } | تدوير رمز الباركود. القيم الصحيحة هي [0، 3]. |
ملاحظات
مجموعة المعلمات وفقًا لخيارات حقل DISPLAYBARCODE. راجع القائمة الدقيقة فيhttps://msdn.microsoft.com/en-us/library/hh745901(v=office.12).aspx
أمثلة
يوضح كيفية استخدام مولد الباركود.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// يمكننا استخدام تنفيذ IBarcodeGenerator مخصص لتوليد الرموز الشريطية،
//ثم قم بإدراجها في المستند كصور.
doc.FieldOptions.BarcodeGenerator = new CustomBarcodeGenerator();
// فيما يلي أربعة أمثلة لأنواع مختلفة من الرموز الشريطية التي يمكننا إنشاؤها باستخدام المولد الخاص بنا.
// بالنسبة لكل رمز شريطي، نحدد مجموعة جديدة من معلمات الرمز الشريطي، ثم نقوم بإنشاء الصورة.
// بعد ذلك، يمكننا إدراج الصورة في المستند، أو حفظها في نظام الملفات المحلي.
// 1 - رمز الاستجابة السريعة:
BarcodeParameters barcodeParameters = new BarcodeParameters
{
BarcodeType = "QR",
BarcodeValue = "ABC123",
BackgroundColor = "0xF8BD69",
ForegroundColor = "0xB5413B",
ErrorCorrectionLevel = "3",
ScalingFactor = "250",
SymbolHeight = "1000",
SymbolRotation = "0"
};
Image img = doc.FieldOptions.BarcodeGenerator.GetBarcodeImage(barcodeParameters);
#if NET461_OR_GREATER || JAVA
img.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.QR.jpg");
#elif NET5_0_OR_GREATER
using (SKFileWStream fs = new SKFileWStream(ArtifactsDir + "FieldOptions.BarcodeGenerator.QR.jpg"))
{
img.Encode(fs, SKEncodedImageFormat.Jpeg, 100);
}
#endif
builder.InsertImage(img);
// 2 - رمز الباركود EAN13:
barcodeParameters = new BarcodeParameters
{
BarcodeType = "EAN13",
BarcodeValue = "501234567890",
DisplayText = true,
PosCodeStyle = "CASE",
FixCheckDigit = true
};
img = doc.FieldOptions.BarcodeGenerator.GetBarcodeImage(barcodeParameters);
#if NET461_OR_GREATER || JAVA
img.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.EAN13.jpg");
#elif NET5_0_OR_GREATER
using (SKFileWStream fs = new SKFileWStream(ArtifactsDir + "FieldOptions.BarcodeGenerator.EAN13.jpg"))
{
img.Encode(fs, SKEncodedImageFormat.Jpeg, 100);
}
#endif
builder.InsertImage(img);
// 3 - الرمز الشريطي CODE39:
barcodeParameters = new BarcodeParameters
{
BarcodeType = "CODE39",
BarcodeValue = "12345ABCDE",
AddStartStopChar = true
};
img = doc.FieldOptions.BarcodeGenerator.GetBarcodeImage(barcodeParameters);
#if NET461_OR_GREATER || JAVA
img.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.CODE39.jpg");
#elif NET5_0_OR_GREATER
using (SKFileWStream fs = new SKFileWStream(ArtifactsDir + "FieldOptions.BarcodeGenerator.CODE39.jpg"))
{
img.Encode(fs, SKEncodedImageFormat.Jpeg, 100);
}
#endif
builder.InsertImage(img);
// 4 - رمز الباركود ITF14:
barcodeParameters = new BarcodeParameters
{
BarcodeType = "ITF14",
BarcodeValue = "09312345678907",
CaseCodeStyle = "STD"
};
img = doc.FieldOptions.BarcodeGenerator.GetBarcodeImage(barcodeParameters);
#if NET461_OR_GREATER || JAVA
img.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.ITF14.jpg");
#elif NET5_0_OR_GREATER
using (SKFileWStream fs = new SKFileWStream(ArtifactsDir + "FieldOptions.BarcodeGenerator.ITF14.jpg"))
{
img.Encode(fs, SKEncodedImageFormat.Jpeg, 100);
}
#endif
builder.InsertImage(img);
doc.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.docx");
أنظر أيضا
- مساحة الاسم Aspose.Words.Fields
- المجسم Aspose.Words