在iOS中用于扫描条形码(代码39格式)的免费SDK

我想扫描一个代码39格式的VIN条形码,使用iphone / ipad的相机。 我尝试了zxing和zbar,但是它们不能正常工作。 大多数时候他们不能识别条形码。 任何人都可以给我一个更好的方式来做到这一点? 或者有什么我可以做的,以增加结果,因为我只需要扫描代码39(VIN车)。

使用Zbar来完成这个。 为了获得足够的分辨率进行扫描,您需要以横向模式扫描条形码。 这里是我的设置(testing和工作)

// ADD: present a barcode reader that scans from the camera feed ZBarReaderViewController *reader = [ZBarReaderViewController new]; reader.readerDelegate = self; reader.supportedOrientationsMask = ZBarOrientationMaskAll; ZBarImageScanner *scanner = reader.scanner; //disable other codes to improve performance [scanner setSymbology: 0 config: ZBAR_CFG_ENABLE to: 0]; [scanner setSymbology:ZBAR_CODE39 config:ZBAR_CFG_ENABLE to:1]; //only scan vertically, in the middle of the screen (also improves performance) [reader setScanCrop:CGRectMake(0, 0.4, 1, 0.2)]; [reader setShowsZBarControls:NO]; [reader setShowsHelpOnFail:NO]; //VERY IMPORTANT: reset zoom. by default, the screen is partially zoomed in and will cause a loss of precision reader.readerView.zoom = 1.0; reader.readerView.allowsPinchZoom=NO; reader.readerView.showsFPS=YES; reader.readerView.tracksSymbols=YES; //scan landscape only (this also improves performance) [scanner setSymbology:ZBAR_CODE39 config:ZBAR_CFG_X_DENSITY to:0]; [scanner setSymbology:ZBAR_CODE39 config:ZBAR_CFG_Y_DENSITY to:1]; 

这应该差不多了! 祝你好运!

编辑/注意:iOS框架现在包含iOS 7以上的条形码扫描器。我使用此实现比使用Zbar获得更好更简单的结果。