亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? barcodeean.java

?? iText可以制作中文PDF文件的JAVA源程序最新版下載
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright 2002 by Paulo Soares. * * The contents of this file are subject to the Mozilla Public License Version 1.1 * (the "License"); you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the License. * * The Original Code is 'iText, a free JAVA-PDF library'. * * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. * All Rights Reserved. * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. * * Contributor(s): all the names of the contributors are added in the source code * where applicable. * * Alternatively, the contents of this file may be used under the terms of the * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the * provisions of LGPL are applicable instead of those above.  If you wish to * allow use of your version of this file only under the terms of the LGPL * License and not to allow others to use your version of this file under * the MPL, indicate your decision by deleting the provisions above and * replace them with the notice and other provisions required by the LGPL. * If you do not delete the provisions above, a recipient may use your version * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. * * This library is free software; you can redistribute it and/or modify it * under the terms of the MPL as stated above or under the terms of the GNU * Library General Public License as published by the Free Software Foundation; * either version 2 of the License, or any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more * details. * * If you didn't download this code from the following link, you should check if * you aren't using an obsolete version: * http://www.lowagie.com/iText/ */package com.lowagie.text.pdf;import com.lowagie.text.Rectangle;import com.lowagie.text.ExceptionConverter;import java.util.Arrays;import java.awt.Color;/** Generates barcodes in several formats: EAN13, EAN8, UPCA, UPCE, * supplemental 2 and 5. The default parameters are: * <pre> *x = 0.8f; *font = BaseFont.createFont("Helvetica", "winansi", false); *size = 8; *baseline = size; *barHeight = size * 3; *guardBars = true; *codeType = EAN13; *code = ""; * </pre> * * @author Paulo Soares (psoares@consiste.pt) */public class BarcodeEAN extends Barcode{            /** The bar positions that are guard bars.*/        static int GUARD_EMPTY[] = {};    /** The bar positions that are guard bars.*/        static int GUARD_UPCA[] = {0, 2, 4, 6, 28, 30, 52, 54, 56, 58};    /** The bar positions that are guard bars.*/        static int GUARD_EAN13[] = {0, 2, 28, 30, 56, 58};    /** The bar positions that are guard bars.*/        static int GUARD_EAN8[] = {0, 2, 20, 22, 40, 42};    /** The bar positions that are guard bars.*/        static int GUARD_UPCE[] = {0, 2, 28, 30, 32};    /** The x coordinates to place the text.*/    static float TEXTPOS_EAN13[] = {6.5f, 13.5f, 20.5f, 27.5f, 34.5f, 41.5f, 53.5f, 60.5f, 67.5f, 74.5f, 81.5f, 88.5f};    /** The x coordinates to place the text.*/    static float TEXTPOS_EAN8[] = {6.5f, 13.5f, 20.5f, 27.5f, 39.5f, 46.5f, 53.5f, 60.5f};    /** The basic bar widths.*/    static byte BARS[][] =     {        {3, 2, 1, 1}, // 0        {2, 2, 2, 1}, // 1        {2, 1, 2, 2}, // 2        {1, 4, 1, 1}, // 3        {1, 1, 3, 2}, // 4        {1, 2, 3, 1}, // 5        {1, 1, 1, 4}, // 6        {1, 3, 1, 2}, // 7        {1, 2, 1, 3}, // 8        {3, 1, 1, 2}  // 9    };        /** The total number of bars for EAN13.*/    static final int TOTALBARS_EAN13 = 11 + 12 * 4;    /** The total number of bars for EAN8.*/    static final int TOTALBARS_EAN8 = 11 + 8 * 4;    /** The total number of bars for UPCE.*/    static final int TOTALBARS_UPCE = 9 + 6 * 4;    /** The total number of bars for supplemental 2.*/    static final int TOTALBARS_SUPP2 = 13;    /** The total number of bars for supplemental 5.*/    static final int TOTALBARS_SUPP5 = 31;    /** Marker for odd parity.*/    static final int ODD = 0;    /** Marker for even parity.*/    static final int EVEN = 1;        /** Sequence of parities to be used with EAN13.*/    static byte PARITY13[][] =    {        {ODD, ODD,  ODD,  ODD,  ODD,  ODD},  // 0        {ODD, ODD,  EVEN, ODD,  EVEN, EVEN}, // 1        {ODD, ODD,  EVEN, EVEN, ODD,  EVEN}, // 2        {ODD, ODD,  EVEN, EVEN, EVEN, ODD},  // 3        {ODD, EVEN, ODD,  ODD,  EVEN, EVEN}, // 4        {ODD, EVEN, EVEN, ODD,  ODD,  EVEN}, // 5        {ODD, EVEN, EVEN, EVEN, ODD,  ODD},  // 6        {ODD, EVEN, ODD,  EVEN, ODD,  EVEN}, // 7        {ODD, EVEN, ODD,  EVEN, EVEN, ODD},  // 8        {ODD, EVEN, EVEN, ODD,  EVEN, ODD}   // 9    };        /** Sequence of parities to be used with supplemental 2.*/    static byte PARITY2[][] =    {        {ODD,  ODD},   // 0        {ODD,  EVEN},  // 1        {EVEN, ODD},   // 2        {EVEN, EVEN}   // 3    };        /** Sequence of parities to be used with supplemental 2.*/    static byte PARITY5[][] =    {        {EVEN, EVEN, ODD,  ODD,  ODD},  // 0        {EVEN, ODD,  EVEN, ODD,  ODD},  // 1        {EVEN, ODD,  ODD,  EVEN, ODD},  // 2        {EVEN, ODD,  ODD,  ODD,  EVEN}, // 3        {ODD,  EVEN, EVEN, ODD,  ODD},  // 4        {ODD,  ODD,  EVEN, EVEN, ODD},  // 5        {ODD,  ODD,  ODD,  EVEN, EVEN}, // 6        {ODD,  EVEN, ODD,  EVEN, ODD},  // 7        {ODD,  EVEN, ODD,  ODD,  EVEN}, // 8        {ODD,  ODD,  EVEN, ODD,  EVEN}  // 9    };        /** Sequence of parities to be used with UPCE.*/    static byte PARITYE[][] =    {        {EVEN, EVEN, EVEN, ODD,  ODD,  ODD},  // 0        {EVEN, EVEN, ODD,  EVEN, ODD,  ODD},  // 1        {EVEN, EVEN, ODD,  ODD,  EVEN, ODD},  // 2        {EVEN, EVEN, ODD,  ODD,  ODD,  EVEN}, // 3        {EVEN, ODD,  EVEN, EVEN, ODD,  ODD},  // 4        {EVEN, ODD,  ODD,  EVEN, EVEN, ODD},  // 5        {EVEN, ODD,  ODD,  ODD,  EVEN, EVEN}, // 6        {EVEN, ODD,  EVEN, ODD,  EVEN, ODD},  // 7        {EVEN, ODD,  EVEN, ODD,  ODD,  EVEN}, // 8        {EVEN, ODD,  ODD,  EVEN, ODD,  EVEN}  // 9    };        /** Creates new BarcodeEAN */    public BarcodeEAN() {        try {            x = 0.8f;            font = BaseFont.createFont("Helvetica", "winansi", false);            size = 8;            baseline = size;            barHeight = size * 3;            guardBars = true;            codeType = EAN13;            code = "";        }        catch (Exception e) {            throw new ExceptionConverter(e);        }    }        /** Calculates the EAN parity character.     * @param code the code     * @return the parity character     */        public static int calculateEANParity(String code) {        int mul = 3;        int total = 0;        for (int k = code.length() - 1; k >= 0; --k) {            int n = code.charAt(k) - '0';            total += mul * n;            mul ^= 2;        }        return (10 - (total % 10)) % 10;    }        /** Converts an UPCA code into an UPCE code. If the code can not     * be converted a <CODE>null</CODE> is returned.     * @param text the code to convert. It must have 12 numeric characters     * @return the 8 converted digits or <CODE>null</CODE> if the     * code could not be converted     */        static public String convertUPCAtoUPCE(String text) {        if (text.length() != 12 || !(text.startsWith("0") || text.startsWith("1")))            return null;        if (text.substring(3, 6).equals("000") || text.substring(3, 6).equals("100")            || text.substring(3, 6).equals("200")) {                if (text.substring(6, 8).equals("00"))                    return text.substring(0, 1) + text.substring(1, 3) + text.substring(8, 11) + text.substring(3, 4) + text.substring(11);        }        else if (text.substring(4, 6).equals("00")) {            if (text.substring(6, 9).equals("000"))                return text.substring(0, 1) + text.substring(1, 4) + text.substring(9, 11) + "3" + text.substring(11);        }        else if (text.substring(5, 6).equals("0")) {            if (text.substring(6, 10).equals("0000"))                return text.substring(0, 1) + text.substring(1, 5) + text.substring(10, 11) + "4" + text.substring(11);        }        else if (text.charAt(10) >= '5') {            if (text.substring(6, 10).equals("0000"))                return text.substring(0, 1) + text.substring(1, 6) + text.substring(10, 11) + text.substring(11);        }        return null;    }        /** Creates the bars for the barcode EAN13 and UPCA.     * @param _code the text with 13 digits     * @return the barcode     */        public static byte[] getBarsEAN13(String _code) {        int code[] = new int[_code.length()];        for (int k = 0; k < code.length; ++k)            code[k] = _code.charAt(k) - '0';        byte bars[] = new byte[TOTALBARS_EAN13];        int pb = 0;        bars[pb++] = 1;        bars[pb++] = 1;        bars[pb++] = 1;        byte sequence[] = PARITY13[code[0]];        for (int k = 0; k < sequence.length; ++k) {            int c = code[k + 1];            byte stripes[] = BARS[c];            if (sequence[k] == ODD) {                bars[pb++] = stripes[0];                bars[pb++] = stripes[1];                bars[pb++] = stripes[2];                bars[pb++] = stripes[3];            }            else {                bars[pb++] = stripes[3];                bars[pb++] = stripes[2];                bars[pb++] = stripes[1];                bars[pb++] = stripes[0];            }        }        bars[pb++] = 1;        bars[pb++] = 1;        bars[pb++] = 1;        bars[pb++] = 1;        bars[pb++] = 1;        for (int k = 7; k < 13; ++k) {            int c = code[k];            byte stripes[] = BARS[c];            bars[pb++] = stripes[0];            bars[pb++] = stripes[1];            bars[pb++] = stripes[2];            bars[pb++] = stripes[3];        }        bars[pb++] = 1;        bars[pb++] = 1;        bars[pb++] = 1;        return bars;    }        /** Creates the bars for the barcode EAN8.     * @param _code the text with 8 digits     * @return the barcode     */        public static byte[] getBarsEAN8(String _code) {        int code[] = new int[_code.length()];        for (int k = 0; k < code.length; ++k)            code[k] = _code.charAt(k) - '0';        byte bars[] = new byte[TOTALBARS_EAN8];        int pb = 0;        bars[pb++] = 1;        bars[pb++] = 1;        bars[pb++] = 1;        for (int k = 0; k < 4; ++k) {            int c = code[k];            byte stripes[] = BARS[c];            bars[pb++] = stripes[0];            bars[pb++] = stripes[1];            bars[pb++] = stripes[2];            bars[pb++] = stripes[3];        }        bars[pb++] = 1;        bars[pb++] = 1;        bars[pb++] = 1;        bars[pb++] = 1;        bars[pb++] = 1;        for (int k = 4; k < 8; ++k) {            int c = code[k];            byte stripes[] = BARS[c];            bars[pb++] = stripes[0];            bars[pb++] = stripes[1];            bars[pb++] = stripes[2];            bars[pb++] = stripes[3];        }        bars[pb++] = 1;        bars[pb++] = 1;        bars[pb++] = 1;        return bars;    }        /** Creates the bars for the barcode UPCE.     * @param _code the text with 8 digits     * @return the barcode     */        public static byte[] getBarsUPCE(String _code) {        int code[] = new int[_code.length()];        for (int k = 0; k < code.length; ++k)            code[k] = _code.charAt(k) - '0';        byte bars[] = new byte[TOTALBARS_UPCE];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色偷偷成人一区二区三区91| 欧美一区二区二区| 男人的j进女人的j一区| 国产精品污网站| 日韩欧美的一区| 在线精品视频小说1| 国产一区美女在线| 午夜视频一区在线观看| 中文一区一区三区高中清不卡| 欧美日韩免费电影| 99精品一区二区| 国产尤物一区二区| 五月天中文字幕一区二区| 国产精品狼人久久影院观看方式| 欧美一区2区视频在线观看| 99re6这里只有精品视频在线观看| 老司机免费视频一区二区| 亚洲一区二区三区小说| 国产精品久久影院| 国产欧美日韩综合精品一区二区 | 麻豆91在线看| 亚洲黄色在线视频| 国产精品欧美一区二区三区| 精品国产一区二区三区不卡| 欧美老年两性高潮| 色八戒一区二区三区| 成人免费的视频| 国产精品一线二线三线| 久久国产三级精品| 视频一区二区欧美| 天堂一区二区在线| 午夜伊人狠狠久久| 亚洲成人一二三| 亚洲电影中文字幕在线观看| 亚洲精选视频在线| 亚洲婷婷综合久久一本伊一区| 久久精品视频网| 国产欧美一区视频| 国产精品美女久久久久高潮| 国产亚洲欧美日韩在线一区| 久久亚洲一级片| 久久亚洲综合av| 精品99久久久久久| 国产色产综合产在线视频| 久久亚洲一区二区三区四区| 久久免费视频一区| 国产女同互慰高潮91漫画| 国产视频一区在线播放| 国产午夜精品美女毛片视频| 国产精品久久久久三级| 中文字幕亚洲视频| 亚洲精品福利视频网站| 亚欧色一区w666天堂| 五月天久久比比资源色| 三级久久三级久久久| 精品在线播放免费| 国产91精品精华液一区二区三区| 福利一区福利二区| 色综合欧美在线视频区| 中文字幕一区二区视频| 亚洲欧美综合网| 亚洲人123区| 丝袜亚洲另类欧美| 久久精品国产在热久久| 成人中文字幕合集| 欧洲精品视频在线观看| 欧美精品v日韩精品v韩国精品v| 日韩视频在线观看一区二区| 久久久久久久久岛国免费| 136国产福利精品导航| 午夜精品在线看| 麻豆成人久久精品二区三区小说| 国产精品一区二区x88av| 91香蕉视频mp4| 91精品国产品国语在线不卡| 久久五月婷婷丁香社区| 日韩美女视频一区| 日本视频一区二区三区| 成人av免费在线播放| 欧美午夜精品免费| 久久新电视剧免费观看| 亚洲另类一区二区| 国产主播一区二区| 91黄色激情网站| 26uuu国产在线精品一区二区| 国产精品国产三级国产aⅴ中文 | 日韩一卡二卡三卡四卡| 中文字幕乱码亚洲精品一区| 亚洲不卡av一区二区三区| 国产精品亚洲综合一区在线观看| 欧美亚洲综合久久| 国产亚洲成年网址在线观看| 亚洲曰韩产成在线| 国产aⅴ精品一区二区三区色成熟| 在线视频综合导航| 国产亚洲1区2区3区| 午夜精品久久久久久久| 成人ar影院免费观看视频| 日韩美女主播在线视频一区二区三区| 国产精品嫩草99a| 蜜桃在线一区二区三区| 日本大香伊一区二区三区| 欧美xxxx老人做受| 日韩精品一级二级| 色婷婷精品久久二区二区蜜臀av| 亚洲精品一区二区三区四区高清 | 日韩国产在线观看| 一本色道久久综合亚洲91| 久久久噜噜噜久久人人看| 日韩成人精品在线观看| 91农村精品一区二区在线| 国产亚洲美州欧州综合国| 美女被吸乳得到大胸91| 欧美日韩一级黄| 一区二区三区免费| av资源站一区| 欧美国产成人在线| 国产久卡久卡久卡久卡视频精品| 欧美一区二区三区四区久久| 亚洲永久精品国产| 色视频成人在线观看免| 国产精品女同一区二区三区| 国产在线精品一区二区不卡了| 欧美乱妇15p| 亚洲1区2区3区4区| 欧美无砖砖区免费| 99国产精品久久久| 国产精品三级电影| 菠萝蜜视频在线观看一区| 国产欧美日韩三区| 国产99久久久精品| 亚洲国产精品成人综合色在线婷婷| 黑人精品欧美一区二区蜜桃| 日韩欧美资源站| 伦理电影国产精品| 日韩你懂的电影在线观看| 日韩国产高清影视| 欧美一区二区三区免费大片| 亚洲国产色一区| 欧美伦理电影网| 日本不卡一二三| 日韩三级精品电影久久久| 久久狠狠亚洲综合| 久久九九久久九九| 国产91在线观看| 国产精品蜜臀av| 91丝袜美女网| 亚洲影院理伦片| 欧美精品日韩一区| 男男成人高潮片免费网站| 精品电影一区二区三区| 国产xxx精品视频大全| 中文字幕亚洲一区二区va在线| 91丝袜国产在线播放| 亚洲电影一区二区| 日韩欧美在线综合网| 国产精品亚洲专一区二区三区| 国产精品久久国产精麻豆99网站| 99精品欧美一区二区三区小说| 亚洲一区二区三区四区在线免费观看 | 欧美精选一区二区| 美女mm1313爽爽久久久蜜臀| 国产亚洲精品7777| 色综合色狠狠综合色| 日韩成人精品在线观看| 久久综合av免费| 91麻豆国产香蕉久久精品| 亚洲国产精品欧美一二99| 欧美一级理论片| 国产91精品久久久久久久网曝门| 亚洲精品菠萝久久久久久久| 欧美精品亚洲二区| 国产经典欧美精品| 一区二区三区欧美激情| 日韩一级精品视频在线观看| 国产精品18久久久久久久久| 亚洲青青青在线视频| 日韩精品中文字幕在线不卡尤物| 丁香亚洲综合激情啪啪综合| 夜夜嗨av一区二区三区网页 | 色综合亚洲欧洲| 免播放器亚洲一区| 亚洲欧美日韩在线不卡| 日韩免费高清av| 欧洲一区二区av| 国产成人免费视频网站| 午夜电影一区二区| 国产精品久久久久久久久图文区| 欧美一区二区大片| 99热99精品| 国产麻豆精品视频| 亚洲h动漫在线| 中文字幕一区二区三| 精品成人一区二区三区四区| 欧美亚洲国产bt| av中文字幕亚洲| 国产九色sp调教91| 琪琪一区二区三区| 亚洲成人综合网站| 亚洲图片欧美激情|