Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

New format extension on iOS - Interleaved2of5 #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Rb.Forms.Barcode.Pcl/Barcode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public enum BarcodeFormat
QrCode = 256,
UpcA = 512,
UpcE = 1024,
Pdf417 = 2048
Pdf417 = 2048,
Interleaved2of5 = 4096,
}

public BarcodeFormat Format { get; private set; }
Expand Down
2 changes: 2 additions & 0 deletions Rb.Forms.Barcode.iOS/Extensions/BarcodeFormatExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public static AVMetadataObjectType ConvertToIOS(this IList<RebuyBarcode.BarcodeF
{ RebuyBarcode.BarcodeFormat.Pdf417, AVMetadataObjectType.PDF417Code },
{ RebuyBarcode.BarcodeFormat.QrCode, AVMetadataObjectType.QRCode },
{ RebuyBarcode.BarcodeFormat.UpcE, AVMetadataObjectType.UPCECode },
{ RebuyBarcode.BarcodeFormat.Interleaved2of5, AVMetadataObjectType.Interleaved2of5Code },
};

foreach (RebuyBarcode.BarcodeFormat barcode in barcodeFormat) {
Expand All @@ -46,6 +47,7 @@ public static RebuyBarcode.BarcodeFormat ConvertToPcl(this AVMetadataObjectType
{ AVMetadataObjectType.PDF417Code, RebuyBarcode.BarcodeFormat.Pdf417 },
{ AVMetadataObjectType.QRCode, RebuyBarcode.BarcodeFormat.QrCode },
{ AVMetadataObjectType.UPCECode, RebuyBarcode.BarcodeFormat.UpcE },
{ AVMetadataObjectType.Interleaved2of5Code, RebuyBarcode.BarcodeFormat.Interleaved2of5 },
};

return !mapping.ContainsKey(type) ? RebuyBarcode.BarcodeFormat.Unknown : mapping[type];
Expand Down