barcode 相关问题

此标记应用于有关如何在程序中生成,解码或使用条形码的问题。

从 GTIN 中提取 GS1 公司前缀

我正在尝试使用 dart 从条形码中获取公司前缀: 字符串 extractCompanyPrefix(字符串 gtin) { // 确保 GTIN 是一个字符串,用于处理前导零并执行字符串操作 ...

回答 1 投票 0

GS1 公司前缀

我正在尝试使用 dart 从条形码中获取公司前缀: 字符串 extractCompanyPrefix(字符串 gtin) { // 确保 GTIN 是一个字符串,用于处理前导零并执行字符串操作 ...

回答 1 投票 0

仅使用 Excel VBA 生成带有控制字符/转义序列的 2D 条形码

我昨天发布了一个问题,诚然缺乏一些细节。为了遵循评论的建议,这里尝试做得更好: 我想生成允许

回答 1 投票 0

亚马逊网络服务API是否支持条形码/UPC查询?

我浏览了他们的文档,一开始发现它有点让人不知所措。我知道您可以通过输入 UPC(一维条形码下方的数字)来搜索商品,但我找不到任何关于我的词...

回答 5 投票 0

将base64值转换为条形码

有人知道如何从 Base64 编码值反向创建条形码吗?这是因为我无法访问真正的许可证,我只是获得了一些创建的 Base64 值的示例...

回答 1 投票 0

为什么当我尝试打印时,我的条码图像不适合条码打印机设置中指定的纸张尺寸?

我正在使用 Zen Barcode Rendering Framework 在 C# Windows 窗体应用程序中创建条形码。我有两个文本框(一个用于条形码本身,一个用于我希望它成为主要内容的相关文本...

回答 1 投票 0

有没有办法在flutter中使用嵌入式条形码阅读器?

我必须使用flutter开发一个移动应用程序。该应用程序要求用户扫描条形码,不是使用手机的摄像头,而是使用嵌入手机顶部的条形码。是...

回答 3 投票 0

为什么条码扫描器会在 Chrome 中打开 Chrome 开发者控制台?

我刚买了一个来自中国的条码阅读器,型号为Honeywell HH400。当我在其他设备上使用它时,它工作得很好。但现在我在我的网络应用程序中使用它,但遇到了问题。它总是切换 C...

回答 3 投票 0

如何生成“Pharmacode”?

我正在做一个项目,我需要生成和读取“pharmacode”。我可以使用条形码生成器库生成“pharmacode”吗? 如果是,请向我推荐任何免费的条形码

回答 0 投票 0

如何读写驾照条形码pdf417?

当我使用 Android 应用程序扫描内华达州驾驶执照背面条形码 pdf417 时,我得到不可读的数据。 @<0xA><0x1E><0xD>ANSI 636049030002DL00410466ZN05070057DLDCABCDE<0xA>

回答 3 投票 0

如何在移动视觉条码扫描仪顶部绘制叠加层?

我一直在努力完成这件事,但过去几天没有成功。我正在尝试在移动设备顶部添加一个方形框覆盖层(如果它也可以包含 2 个按钮,那就太好了)...

回答 1 投票 0

找不到我.dm7.barcodescanner:zbar:1.9.13

我想在我的 android studio 应用程序中使用这个库 https://github.com/dm77/barcodescanner。我按照上述步骤进行操作,例如将库添加到 build.gradle 文件中并添加 jcenter() 但仍然...

回答 2 投票 0

在java中使用selenium Webdriver、appium测试条形码的自动化

我们有一个新的要求,我们想要自动化条形码来测试我们的应用程序,我们计划使用 selenium Webdriver、Appium 和 java。 你能分享一下其他插件吗

回答 1 投票 0

条形码图像未显示在我的 html 网页上

我有一个 django 项目,我用它来创建库存管理系统。我有一个 html 网站,其中显示产品说明。它还应该显示生成的条形码图像...

回答 1 投票 0

条形码阅读器将数字英文文本转换为阿拉伯语

我有一个条形码阅读器,可以将学生卡上的条形码读取到未绑定的访问表单字段中。条形码是英文数字的文本。问题是有时条形码阅读器读取正常......

回答 1 投票 0

了解 ISO/IEC 15418 条形码规范 [已关闭]

我正在尝试学习如何扫描和读取一维和二维条形码中的编码数据。 ISO/IEC 15418 似乎非常详细地详细介绍了我有兴趣阅读的数据。不幸的是,具体...

回答 0 投票 0

Chrome ShapeDetetion API BarcodeDetector 适用于 javascript,但不适用于 typescript

我想在 Angular 应用程序中实现 BarcodeDetector。我使用以下代码测试了 API: HTML: <p>我想在 Angular 应用程序中实现 <a href="https://web.dev/shape-detection/#barcodedetector" rel="nofollow noreferrer">BarcodeDetector</a>。我使用以下代码测试了 API:</p> <p>HTML:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang=&#34;en&#34;&gt; &lt;head&gt; &lt;script src=&#34;./script.js&#34;&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;button onclick=&#34;scan()&#34;&gt;Click me&lt;/button&gt; &lt;img src=&#34;./barcode.gif&#34;&gt; &lt;pre&gt;&lt;/pre&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>JavaScript:</p> <pre><code>function scan() { const images = document.querySelectorAll(&#39;img&#39;); const pres = document.querySelectorAll(&#39;pre&#39;); try { pres[0].textContent += &#39;started\n&#39;; let barcodeDetector = new BarcodeDetector(); pres[0].textContent += &#39;created and detecting\n&#39;; barcodeDetector.detect(images[0]).then(detectedCodes =&gt; { for (const barcode of detectedCodes) { pres[0].textContent += barcode.rawValue + &#39;\n&#39;; }}).catch((e) =&gt; { pres[0].textContent += e + &#39;\n&#39;; }); } catch (e) { pres[0].textContent += e + &#39;\n&#39;; } } </code></pre> <p>而且效果很好。在 PC 上,当我在手机上打开页面时,出现 <pre><code>NotSupported</code></pre> 错误和解码的条形码。</p> <p>由于 TypeScript 是 JavaScript 的超集,我认为移植代码应该非常简单,但显然事实并非如此。 Angular 应用程序中的 HTML 几乎相同。组件代码如下: </p> <pre><code>var BarcodeDetector: any; @Component({ templateUrl: &#39;./index.component.html&#39; }) export class IndexComponent { @ViewChild(&#39;imgRef&#39;) image: ElementRef; hasBarcodeDetector = &#39;&#39;; errors = &#39;&#39;; scanData = &#39;&#39;; constructor() { try { this.hasBarcodeDetector = &#39;BarcodeDetector&#39; in window ? &#39;true&#39; : &#39;false&#39;; const barcodeDetector = new BarcodeDetector(); barcodeDetector.detect(this.image.nativeElement).then(detectedCodes =&gt; { for (const barcode of detectedCodes) { this.scanData += barcode.rawValue + &#39;\n&#39;; } }); } catch (e) { this.errors = e; } } } </code></pre> <p>检查探测器是否存在有效,因为我得到 <pre><code>true</code></pre>,但在 PC 和移动设备上我都收到以下错误:</p> <pre><code>TypeError: (void 0) is not a constructor </code></pre> <p>我猜这与解码器的声明有关,但我真的不知道该怎么做。</p> </question> <answer tick="false" vote="0"> <p>我认为你的变量不小心覆盖了<pre><code>window.BarcodeDetector</code></pre>。另请注意,您没有使用特征检测的结果。顺便说一句,特征检测现在应该以不同的方式进行,正如最近更新的<a href="https://web.dev/shape-detection/#featuredetection" rel="nofollow noreferrer">文章</a>中所述:</p> <pre><code>await BarcodeDetector.getSupportedFormats(); /* On a macOS computer logs [ &#34;aztec&#34;, &#34;code_128&#34;, &#34;code_39&#34;, &#34;code_93&#34;, &#34;data_matrix&#34;, &#34;ean_13&#34;, &#34;ean_8&#34;, &#34;itf&#34;, &#34;pdf417&#34;, &#34;qr_code&#34;, &#34;upc_e&#34; ] */ </code></pre> <p>这允许您检测您需要的特定功能,例如二维码扫描:</p> <pre><code>if ((&#39;BarcodeDetector&#39; in window) &amp;&amp; ((await BarcodeDetector.getSupportedFormats()).includes(&#39;qr_code&#39;))) { console.log(&#39;QR code scanning is supported.&#39;); } </code></pre> </answer> <answer tick="false" vote="0"> <p>我遇到了同样的问题,花了我一些时间。可能不是绝对完美,但以下内容对我有用。</p> <p>我希望在这两种情况下都支持扫描,因为这仅适用于 Mac、Android 和 Chrome 操作系统。</p> <p>希望有帮助!我很感激任何反馈。</p> <pre><code>&lt;div *ngIf=&#34;hasBarcodeDetectorApi&#34; else useWindowsScanning&gt; &lt;video id=&#34;player&#34; #player&gt;&lt;/video&gt; &lt;div&gt;{{consoleMessage}}&lt;/div&gt; &lt;/div&gt; &lt;ng-template #useWindowsScanning&gt; &lt;mso-camera-scan (scanEvent)=&#34;onScanNumber($event)&#34; (cameraError)=&#34;onCameraError()&#34;&gt;&lt;/mso-camera-scan&gt; &lt;/ng-template&gt; </code></pre> <p>我的完整组件,因为即使读取条形码也需要一点努力</p> <pre><code>import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from &#39;@angular/core&#39;; import { BarcodeDetectorApi, BarcodeDetectorOptions } from &#39;./barcode.model&#39;; import { SubSink } from &#39;subsink&#39;; import { concatMap, from, timer } from &#39;rxjs&#39;; // declare keyword tells browser it is defined elsewhere, which is how this works // I&#39;d like to move to the barcode.model file, but compile issues that would take time to figure // eslint-disable-next-line @typescript-eslint/naming-convention, no-var export declare var BarcodeDetector: typeof BarcodeDetectorApi; @Component({ selector: &#39;mso-barcode-detector&#39;, templateUrl: &#39;./barcode-detector.component.html&#39;, changeDetection: ChangeDetectionStrategy.OnPush, }) export class BarcodeDetectorComponent implements OnInit, AfterViewInit, OnDestroy { @Output() scanEvent = new EventEmitter&lt;string&gt;(); @Output() cameraError = new EventEmitter&lt;void&gt;(); @ViewChild(&#39;player&#39;, { static: false }) player: ElementRef&lt;HTMLVideoElement&gt;; hasBarcodeDetectorApi = false; barcodeDetector: BarcodeDetectorApi; consoleMessage: string; private subsink = new SubSink(); private mediaStream: MediaStream = null; constructor() { if (!!window[&#39;BarcodeDetector&#39;]) { /* BarcodeDetector API only available on Mac, Android, and Chrome OS as of this note If you are on Windows then return and use a backup method of checking for barcodes */ this.hasBarcodeDetectorApi = true; } } ngOnInit(): void { if (!this.hasBarcodeDetectorApi) { return; } console.log(&#39;Using BarcodeDetector API&#39;); const options = {} as BarcodeDetectorOptions; options.formats = [&#39;code_128&#39;]; this.barcodeDetector = new BarcodeDetector(options); } ngAfterViewInit(): void { if (!this.hasBarcodeDetectorApi) { return; } const constraints = { video: { facingMode: &#39;environment&#39;, }, } as MediaStreamConstraints; navigator.mediaDevices.getUserMedia(constraints).then((stream) =&gt; { // Attach the video stream to the video element and autoplay. this.player.nativeElement.srcObject = stream; this.mediaStream = stream; this.player.nativeElement.play().then(() =&gt; { this.startListeningToBarcodes(); }); }); } ngOnDestroy(): void { if (this.mediaStream) { this.player.nativeElement.pause(); this.mediaStream.getTracks().forEach(x =&gt; x.stop()); } this.subsink.unsubscribe(); } onScanNumber(barcode: string): void { this.scanEvent.emit(barcode); } onCameraError(): void { this.cameraError.emit(); } private startListeningToBarcodes(): void { /* Now that we&#39;ve started the video we need to check for a barcode in intervals as the detect function checks exactly once when you call it We want to continue to check until we find a valid barcode */ this.subsink.sink = timer(250, 500).pipe( concatMap(() =&gt; from(this.barcodeDetector .detect(this.player.nativeElement) .then((barcodes) =&gt; { if (barcodes.length === 0) { return; } console.log(`found ${barcodes.length} barcodes`); barcodes.forEach((barcode) =&gt; { console.log(barcode.rawValue); this.onScanNumber(barcode.rawValue); }); }) .catch((err) =&gt; { this.consoleMessage = err; console.log(err); this.onCameraError(); })))) .subscribe(); } } </code></pre> <p>最后,让它发挥作用的模型</p> <pre><code>// cheating by defining what it would look like, no implementation // interface doesn&#39;t like to define constructor or static very easily export class BarcodeDetectorApi { static getSupportedFormats(): Promise&lt;BarcodeFormat[]&gt; { throw new Error(&#39;not implemented&#39;); } constructor(barcodeDetectorOptions?: BarcodeDetectorOptions) { } detect(image: ImageBitmapSource): Promise&lt;DetectedBarcode[]&gt; { throw new Error(&#39;not implemented&#39;); } } export interface BarcodeDetectorOptions { formats?: Array&lt;BarcodeFormat&gt;; }; export interface Point2D { x: number; y: number; }; export interface DetectedBarcode { boundingBox: DOMRectReadOnly; rawValue: string; format: BarcodeFormat; cornerPoints: ReadonlyArray&lt;Point2D&gt;; }; export type BarcodeFormat = &#39;aztec&#39; | &#39;code_128&#39; | &#39;code_11&#39; | &#39;code_39&#39; | &#39;code_93&#39; | &#39;codabar&#39; | &#39;data_matrix&#39; | &#39;ean_13&#39; | &#39;ean_8&#39; | &#39;itf&#39; | &#39;pdf417&#39; | &#39;qr_code&#39; | &#39;micro_qr_code&#39; | &#39;maxi_code&#39; | &#39;upc_a&#39; | &#39;upc_e&#39; | &#39;gs1_composite&#39; | &#39;gs1_databar&#39; | &#39;gs1_databar_expanded&#39; | &#39;gs1_databar_expanded_stacked&#39; | &#39;gs1_databar_limited&#39; | &#39;gs1_databar_omnidirectional&#39; | &#39;gs1_databar_stacked&#39; | &#39;gs1_databar_stacked_omnidirectional&#39; | &#39;gs1_databar_truncated&#39; | &#39;unknown&#39;; </code></pre> </answer> </body></html>

回答 0 投票 0

加速easyocr

我开发了一个 Android 应用程序,在处理输入图像期间使用 chaquopy 运行 easyocr 和 pyzbar 模块。该应用程序的目标是能够提取文本并解码条形码...

回答 1 投票 0

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

我想使用iphone/ipad的相机扫描Code 39格式的VIN条形码。我尝试了 zxing 和 zbar,但它们效果不佳。大多数时候他们无法识别条形码。任何人都可以...

回答 1 投票 0

如何在 Swift 中从字符串生成条形码?

我是一名新的 iOS 开发人员。我想知道如何在 Swift 中生成条形码。 我已经有了代码,有多种资源可以学习如何读取条形码,但我没有找到...

回答 5 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.