logo Enterprise-level component library based on Bootstrap and Blazor
gitee
version
license
download
repo
commit
build
coverage

IBaiduOcr

Character recognition

Precautions
This component relies on BootstrapBlazor.BaiduOcr, which needs to reference its component package when using this component
Nuget Install
Use nuget.org to install BootstrapBlazor.BaiduOcr component
.NET CLI
dotnet add package BootstrapBlazor.BaiduOcr
PackageReference
<PackageReference Include="BootstrapBlazor.BaiduOcr" Version="7.1.1" />
Package Manager
Install-Package BootstrapBlazor.BaiduOcr
Usage
1. Get IBaiduOcr instance by inject service
2. Call IBaiduOcr instance method

Call Baidu Ocr interface for text recognition by uploading VAT invoice image

Demo

通过调用 IBaiduOcr 服务实例的发票验真方法 VerifyInvoiceAsync 返回 InvoiceVerifyResult 其属性 Validtrue 时为真

Demo

发票种类

增值税专用发票:special_vat_invoice
增值税电子专用发票:elec_special_vat_invoice
增值税普通发票:normal_invoice
增值税普通发票(电子):elec_normal_invoice
增值税普通发票(卷式):roll_normal_invoice
通行费增值税电子普通发票:toll_elec_normal_invoice
区块链电子发票(目前仅支持深圳地区):blockchain_invoice
全电发票(专用发票):elec_invoice_special
全电发票(普通发票):elec_invoice_normal
货运运输业增值税专用发票:special_freight_transport_invoice
机动车销售发票:motor_vehicle_invoice
二手车销售发票:used_vehicle_invoice
Loading...
@page "/ocr"
@inject IStringLocalizer<BaiduOcr> Localizer

<h3>IBaiduOcr</h3>

<h4>Character recognition</h4>

<Tips class="mt-3">本组件通过调用 Baidu AI 平台文字识别接口进行增值税发票文字识别。支持对增值税普票、专票、全电发票(新版全国统一电子发票,专票/普票)、卷票、区块链发票的所有字段进行结构化识别,包括发票基本信息、销售方及购买方信息、商品信息、价税信息等,其中五要素字段的识别准确率超过 99.9%; 同时,支持对增值税卷票的 21 个关键字段进行识别,包括发票类型、发票代码、发票号码、机打号码、机器编号、收款人、销售方名称、销售方纳税人识别号、开票日期、购买方名称、购买方纳税人识别号、项目、单价、数量、金额、税额、合计金额(小写)、合计金额(大写)、校验码、省、市,四要素字段的识别准确率可达95%。上传图片不能超过 4M</Tips>

<PackageTips Name="BootstrapBlazor.BaiduOcr" />

<div class="mb-2"><b>Usage</b></div>

<div>1. Get <code>IBaiduOcr</code> instance by inject service</div>
<div>2. Call <code>IBaiduOcr</code> instance method</div>

<DemoBlock Title="VAT Invoice" Introduction="Call Baidu Ocr interface for text recognition by uploading VAT invoice image" Name="VatInvoice" Demo="typeof(Demos.BaiduOcr.BaiduOcrNormal)" />

<DemoBlock Title="增值税验真" Introduction="通过调用 <code>IBaiduOcr</code> 服务实例的发票验真方法 <code>VerifyInvoiceAsync</code> 返回 <code>InvoiceVerifyResult</code> 其属性 <code>Valid</code> 为 <code>true</code> 时为真" Name="Verify" Demo="typeof(Demos.BaiduOcr.BaiduOcrVerifyVatInvoice)">
    <h4 class="mb-2">发票种类</h4>
    <div>增值税专用发票:special_vat_invoice</div>
    <div>增值税电子专用发票:elec_special_vat_invoice</div>
    <div>增值税普通发票:normal_invoice</div>
    <div>增值税普通发票(电子):elec_normal_invoice</div>
    <div>增值税普通发票(卷式):roll_normal_invoice</div>
    <div>通行费增值税电子普通发票:toll_elec_normal_invoice</div>
    <div>区块链电子发票(目前仅支持深圳地区):blockchain_invoice</div>
    <div>全电发票(专用发票):elec_invoice_special</div>
    <div>全电发票(普通发票):elec_invoice_normal</div>
    <div>货运运输业增值税专用发票:special_freight_transport_invoice</div>
    <div>机动车销售发票:motor_vehicle_invoice</div>
    <div class="mb-3">二手车销售发票:used_vehicle_invoice</div>
</DemoBlock>
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/

namespace BootstrapBlazor.Shared.Samples;

/// <summary>
/// 百度文字识别示例
/// </summary>
public partial class BaiduOcr
{
}

B station related video link

No

交流群

QQ Group:BootstrapAdmin & Blazor 795206915 675147445 Welcome to join the group discussion
img
Themes
Bootstrap
Motronic
Ant Design (完善中)
DevUI (制作中)
LayUI (完善中)
An error has occurred. This application may no longer respond until reloaded. Reload
Seems like the connection with the server has been lost. It can be due to poor or broken network. Please hang on while we're trying to reconnect...
Oh snap! Failed to reconnect with the server. This is typically caused by a longer network outage, or if the server has been taken down. You can try to reconnect, but if that does not work, you need to reload the page.
Oh man! The server rejected the attempt to reconnect. The only option now is to reload the page, but be prepared that it won't work, since this is typically caused by a failure on the server.
Bootstrap Blazor Component library updated to 7.2.5-beta02

Bootstrap Blazor at present has more than 120 components. This component is based on Bootstrap Blazor An enterprise-level component library that provides several types of common components such as layout, navigation, form, data, notification, icon, voice, etc. Each component has been carefully designed with modularity, responsiveness and excellent performance. Starting from more practical scenarios, meeting the needs of various scenarios, greatly reducing the time cost of developers, greatly shortening the development cycle, greatly improving development efficiency, and providing a set of General Rights Management System Example project。Bootstrap Blazor Products are maintained by a professional full-time technical team, with efficient response speed, diversified solutions, long-term support, and enterprise-level support. At present, it has been used in many well-known state-owned enterprises, and the project is running stably with a maximum of 1200 people online. On the right is the QR code of the Chinese Blazor QQ community with the largest number of people in China, welcome to scan and join the group.

component updated to 6.6.0 Change log [portal] If the component brings you convenience, please help to light up the project Star github gitee

QQGroup
QQ 795206915