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. القيم الصالحة هي [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);
img.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.QR.jpg");
builder.InsertImage(img);
// 2 - الرمز الشريطي EAN13:
barcodeParameters = new BarcodeParameters
{
BarcodeType = "EAN13",
BarcodeValue = "501234567890",
DisplayText = true,
PosCodeStyle = "CASE",
FixCheckDigit = true
};
img = doc.FieldOptions.BarcodeGenerator.GetBarcodeImage(barcodeParameters);
img.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.EAN13.jpg");
builder.InsertImage(img);
// 3 - الرمز الشريطي CODE39:
barcodeParameters = new BarcodeParameters
{
BarcodeType = "CODE39",
BarcodeValue = "12345ABCDE",
AddStartStopChar = true
};
img = doc.FieldOptions.BarcodeGenerator.GetBarcodeImage(barcodeParameters);
img.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.CODE39.jpg");
builder.InsertImage(img);
// 4 - الباركود ITF14:
barcodeParameters = new BarcodeParameters
{
BarcodeType = "ITF14",
BarcodeValue = "09312345678907",
CaseCodeStyle = "STD"
};
img = doc.FieldOptions.BarcodeGenerator.GetBarcodeImage(barcodeParameters);
img.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.ITF14.jpg");
builder.InsertImage(img);
doc.Save(ArtifactsDir + "FieldOptions.BarcodeGenerator.docx");
أنظر أيضا
- مساحة الاسم Aspose.Words.Fields
- المجسم Aspose.Words