码迷,mamicode.com
首页 > 其他好文 > 详细

PDF417条码简介

时间:2015-08-17 11:30:21      阅读:289      评论:0      收藏:0      [点我收藏+]

标签:

    PDF417是美国符号科技(Symbol Technologies, Inc.)发明的二维条码,发明人是台湾赴美学人王寅君博士,王博士於1984年毕业於国立交通大学资讯系,获得纽约州立大学石溪分校(University of New York at Stony Brook)电脑硕士和博士学位後,在1988年进入符号科技进行二维条码的研发工作,於1992年底推出PDF417,并於1989年至1992年间领导世界第一部二维条码雷射读码系统的开发。1993年3月作者正式将PDF417引进台湾,交由祥记资讯推广及研发相关套装软体(黄庆祥,1995)。

    目前PDF417、Maxicode、Datamatrix同被美国国家标准协会 (American National Standards Institute, ANSI) MH10 SBC-8委员会选为二维条码国际标准制定范围,其中PDF417主要是预备应用於运输包裹与商品资料标签(Burnell, 1995)。PDF417不仅具有错误侦测能力,且可从受损的条码中读回完整的资料(Moore, 1994),亦即「错误复原能力」,其错误复原率最高可达50%,如图8.1所列各种情形,皆可将资料复原。

技术分享
图8.1 PDF417的错误复原能力

PDF417二维条码的结构

   由於PDF417二维条码的容量较大,除了可将人的姓名、单位、地址、电话等基本资料进行编码外,还可将人体的特徵如指纹、视网膜扫瞄、及照片等个人纪录储存在条码中,这样不但可以实现证件资料的自动输入,而且可以防止证件的伪造,减少犯罪。PDF417已在美国、加拿大、纽西兰的交通部门的执照年审、车辆违规登记、罚款及定期检验上开始应用。美国并同时将PDF417应用在身分证、驾照、军人证上。此外墨西哥也将PDF417应用在报关单据与证件上,从而防止了仿造及犯罪。

    PDF417是一个公开码,任何人皆可用其演算法而不必付费,因此是一个开放的条码系统。PDF417的PDF为可携性资料档(Portable Data File)的缩写,取其条码类似一个资料档,可储存较多资料,且可随身携带或随产品走而得名(Paclidis, 1992)。正如其名,每一个PDF码的储存量可高达1,108个文数字(Bytes),若将数字压缩则可存放至2,729Bytes。

    每一个PDF417码是由3~90横列堆叠而成,而为了扫瞄方便,其四周皆有静空区,静空区分为水平静空区与垂直静空区,至少应为0.020寸,如图8.2所示。

技术分享
图8.2 PDF417码的结构

其中每一层都包括下列五个部份:

  1. 起始码
     

  2. 左标区:在起始码後面,为一指示符号字元。
     

  3. 资料区:可容纳1~30个资料字元。
     

  4. 右标区: 在资料区的後面,为一指示符号字元。
     

  5. 结束码:在横列之最右边。

    除了起始码和结束码外,左标区、资料区和右标区的组成字元皆可称为字码 (Codeword),每一个字码由17个模组(Modules)所构成,每一个字码又可分成4线条(或黑线)及4空白(或白线),每个线条至多不能超过6个模组宽。每个417码因资料大小不同,其行数及每行的资料模组数与字码数都可以从1至30不等。字码的组成如图8.3所示。

技术分享
图8.3 PDF417字码的组成

 

PDF417二维条码的尺寸

    也因为符号的组合较有弹性,每一个PDF417二维条码可因应不同的实体设备印成不同的长宽比例与密度,以适应印刷条件及扫瞄条件的要求。其中每个模组宽X是PDF417码中最重要的尺寸之一,X值的最小限制为0.0075英寸(约0.191mm),在同一个条码符号中,X的值是固定不变的。

PDF417的最小高度与长度可由下列算式算出: 

W= (17C+69)X+ 2Q

H = R ×Y+ 2Q

其中:

W= 条码宽度,H=条码高度,X=条码模组宽,Y=层数

C=每层符号字元的总数(含左右标区),R=层高,Q=静空区大小

 

PDF417二维条码的错误纠正能力  

    PDF417二维条码的一个重要特性是其自动纠正错误的能力较高,不过PDF417的错误纠正能力与每个条码可存放的资料量有关,PDF417码将错误复原分为9个等级,其值从0到8,级数愈高,错误纠正能力愈强,但可存放资料量就愈少,一般建议编入至少10%的检查字码。资料存放量与错误纠正等级的关系如表8.1所示。表8.2则建议不同的字数所适用的错误纠正等级。

表8.1 可存放资料量与错误纠正等级对照表

错误纠正等级

纠正码数

可存资料量(位元)

自动设定

64

1024

0

2

1108

1

4

1106

2

8

1101

3

16

1092

4

32

1072

5

64

1024

6

128

957

7

256

804

8

512

496

表8.2 PDF417的建议错误纠正等级

资料字码数

错误纠正等级

1~40

2

40~160

3

161~320

4

321~863

5

    如前所述,错误纠正等级涉及拒读错误(E错误)与替代错误(T错误)两种错误类型。无论使用哪一种条码机都有一定的精密度极限,造成线条和空白的宽度与理想宽度间必有偏差存在,条码扫瞄设备能够读出解码演算法所允许范围内的不精确条码符号,目前标准中规定X的值最小为0.0075英寸(约0.191mm),此一限制同时反映出目前标准设备的技术现状。综合本节所讨论,PDF417的特性如表8.3所示。

表8.3 PDF417的特性

项目

特性

可编码字元集 8位二进制资料,多达811800种不同的字元集或解释
类型 连续型,多层
字元自我检查
尺寸 可变

高:3~90

宽:1~30

读码方式 双向可读
错误纠正字码数 2~512
最大资料容量 安全等级为0 每个符号可表示1108个位元
 
 
 
SAP内的PDF417
******************* PDF417 *******************

PDF417 is a two-dimensional bar code to represent datasets that are larger as the usual datasets in one-dimensional bar codes (for example, more than 1,000 characters). The entire 7-Bit ASCII character set is generally processed (binary values 1 - 127, the value 0 is not permitted).
A PDF417 bar code consists of 3 to 90 consecutive rows. Every row consists of a start/stop indicator and "code words". A code word consists of 4 bars and 4 spaces. The minimum number of code words per row is three.

Parameters for PDF417:
  • Narrow module width
    Value range: 1 to 10
    This is the width for the narrowest module of a bar code, measured in pixels. Value 1 generates the "narrowest", value 10 the widest bars or spaces.
  • Linear height
    Value range: 1 to 9999
    This parameter currently has no effect on PDF417. The height of a PDF417 symbol is controlled by parameter "Single Row Height" and the number of columns and rows, in conjunction with the length of text data to be encoded.
  • Single row height
    Value range: 1 to 32000
    This value, multiplied by the narrow module width, returns the height of the individual rows of a PDF417 symbol, measured in pixels. Caution: Do NOT use the value 1 for this parameter
  • Security level
    Value range:  0, 1-8
    This parameter controls the number of code words that are generated for error recognition and error correction. The default value 0, however, only permits error recognition but no automatic correction. If you increase the security level, the level of error correction increases with it (this increases the size of the bar code).
  • Number of columns
    Here, you can define the number of the code word columns which you can use to check the width of the bar code.
    Value range:
    0 (default value) : A row/column ratio of 1:2 is used.
    Permitted values: 1 to 30
  • Number of rows
    Here, you can define the number of rows which can be used to check the height of the bar code.
    Value range:
    0 (default value) : A row/column ratio of 1:2 is used.
    Permitted values: 3 to 90
    For example: If you leave both parameters set to the default value 0, the system would convert 72 code words in a bar code symbol with 6 columns and 12 rows.
  • Truncation
    Value range:  X equals YES, blank character equals No
    This indicator determines if the right row indicator and the stop pattern are to be truncated (this saves space).

The following character combinations in the transferred bar code data have the special function:
\&    - This represents the end of a line (Carriage Return + Newline)
\\    - This represents a backslash (5C hexadecimal)
\0xYY - This represents a single byte with the value YY (hexadecimal)
        For example: \0x1E is output as a single byte with the value 1E (hex)
        or 30 (decimal).

Comments:
- If you specify values higher than zero for Number of columns and Number of rows, the result of both values must be less than 928.
- A bar code is not printed if the total of Columns and Rows is higher than 928.
- A bar code is not printed if the total number of code words is greater than Columns multiplied by Rows.
- You can use Truncation if it is unlikely that the bar code will be damaged.

PDF417条码简介

标签:

原文地址:http://www.cnblogs.com/snailrun/p/4735953.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!