Asp classic 创建函数条码asp FPDF

Asp classic 创建函数条码asp FPDF,asp-classic,fpdf,Asp Classic,Fpdf,不久前,我控制了这个库,“——基于FPDF、php,但面向ASP,我用它来挂载银行,但在尝试挂载设置条形码的函数时,我面临以下问题 下面是代码FPDF this.Codabar=function Codabar(xpos, ypos, code) { var start='A'; var end='A'; var basewidth=0.35; var height=16; barChar = array (

不久前,我控制了这个库,“——基于FPDF、php,但面向ASP,我用它来挂载银行,但在尝试挂载设置条形码的函数时,我面临以下问题

下面是代码FPDF

this.Codabar=function Codabar(xpos, ypos, code) {
        var start='A';
        var end='A';
        var basewidth=0.35;
        var height=16;
    barChar = array (
        '0' = array (6.5, 10.4, 6.5, 10.4, 6.5, 24.3, 17.9),
        '1' = array (6.5, 10.4, 6.5, 10.4, 17.9, 24.3, 6.5),
        '2' = array (6.5, 10.0, 6.5, 24.4, 6.5, 10.0, 18.6),
        '3' = array (17.9, 24.3, 6.5, 10.4, 6.5, 10.4, 6.5),
        '4' = array (6.5, 10.4, 17.9, 10.4, 6.5, 24.3, 6.5),
        '5' = array (17.9,    10.4, 6.5, 10.4, 6.5, 24.3, 6.5),
        '6' = array (6.5, 24.3, 6.5, 10.4, 6.5, 10.4, 17.9),
        '7' = array (6.5, 24.3, 6.5, 10.4, 17.9, 10.4, 6.5),
        '8' = array (6.5, 24.3, 17.9, 10.4, 6.5, 10.4, 6.5),
        '9' = array (18.6, 10.0, 6.5, 24.4, 6.5, 10.0, 6.5),
        '$' = array (6.5, 10.0, 18.6, 24.4, 6.5, 10.0, 6.5),
        '-' = array (6.5, 10.0, 6.5, 24.4, 18.6, 10.0, 6.5),
        ':' = array (16.7, 9.3, 6.5, 9.3, 16.7, 9.3, 14.7),
        '/' = array (14.7, 9.3, 16.7, 9.3, 6.5, 9.3, 16.7),
        '.' = array (13.6, 10.1, 14.9, 10.1, 17.2, 10.1, 6.5),
        '+' = array (6.5, 10.1, 17.2, 10.1, 14.9, 10.1, 13.6),
        'A' = array (6.5, 8.0, 19.6, 19.4, 6.5, 16.1, 6.5),
        'T' = array (6.5, 8.0, 19.6, 19.4, 6.5, 16.1, 6.5),
        'B' = array (6.5, 16.1, 6.5, 19.4, 6.5, 8.0, 19.6),
        'N' = array (6.5, 16.1, 6.5, 19.4, 6.5, 8.0, 19.6),
        'C' = array (6.5, 8.0, 6.5, 19.4, 6.5, 16.1, 19.6),
        '*' = array (6.5, 8.0, 6.5, 19.4, 6.5, 16.1, 19.6),
        'D' = array (6.5, 8.0, 6.5, 19.4, 19.6, 16.1, 6.5),
        'E' = array (6.5, 8.0, 6.5, 19.4, 19.6, 16.1, 6.5));
    this.SetFont('Arial','',13);
    this.Text(xpos, ypos + height + 4, code);
    this.SetFillColor(0);
    code = strtoupper(start.code.end);
    for(i=0; i<strlen(code); i++){
        char = code[i];
        if(!isset(barChar[char])){
            this.Error('Invalid character in barcode: '.char);
        }
        seq = barChar[char];
        for(bar=0; bar<7; bar++){
            lineWidth = basewidth*seq[bar]/6.5;
            if(bar % 2 == 0){
                this.Rect(xpos, ypos, lineWidth, height, 'F');
            }
            xpos += lineWidth;
        }
        xpos += basewidth*10.4/6.5;
    }
}
埃罗 Microsoft JScript运行时错误“800a138f”

预期对象

/exec/boleto/fpdf.asp,第2679行->此行,文档中不存在此项

This.Codabar=函数Codabar(xpos、ypos、codice){
this.Codabar=function Codabar(xpos, ypos, codice) {
        var basewidth=0.35;
        var height=16;
        var barChar=new Array();
        barChar['0'] = new Array (6.5, 10.4, 6.5, 10.4, 6.5, 24.3, 17.9);
        barChar['1'] = new Array (6.5, 10.4, 6.5, 10.4, 17.9, 24.3, 6.5);
        barChar['2'] = new Array (6.5, 10.0, 6.5, 24.4, 6.5, 10.0, 18.6);
        barChar['3'] = new Array (17.9, 24.3, 6.5, 10.4, 6.5, 10.4, 6.5);
        barChar['4'] = new Array (6.5, 10.4, 17.9, 10.4, 6.5, 24.3, 6.5);
        barChar['5'] = new Array (17.9,    10.4, 6.5, 10.4, 6.5, 24.3, 6.5);
        barChar['6'] = new Array (6.5, 24.3, 6.5, 10.4, 6.5, 10.4, 17.9);
        barChar['7'] = new Array (6.5, 24.3, 6.5, 10.4, 17.9, 10.4, 6.5);
        barChar['8'] = new Array (6.5, 24.3, 17.9, 10.4, 6.5, 10.4, 6.5);
        barChar['9'] = new Array (18.6, 10.0, 6.5, 24.4, 6.5, 10.0, 6.5);
        barChar['$'] = new Array (6.5, 10.0, 18.6, 24.4, 6.5, 10.0, 6.5);
        barChar['-'] = new Array (6.5, 10.0, 6.5, 24.4, 18.6, 10.0, 6.5);
        barChar[':'] = new Array (16.7, 9.3, 6.5, 9.3, 16.7, 9.3, 14.7);
        barChar['/'] = new Array (14.7, 9.3, 16.7, 9.3, 6.5, 9.3, 16.7);
        barChar['.'] = new Array (13.6, 10.1, 14.9, 10.1, 17.2, 10.1, 6.5);
        barChar['+'] = new Array (6.5, 10.1, 17.2, 10.1, 14.9, 10.1, 13.6);
        barChar['A'] = new Array (6.5, 8.0, 19.6, 19.4, 6.5, 16.1, 6.5);
        barChar['T'] = new Array (6.5, 8.0, 19.6, 19.4, 6.5, 16.1, 6.5);
        barChar['B'] = new Array (6.5, 16.1, 6.5, 19.4, 6.5, 8.0, 19.6);
        barChar['N'] = new Array (6.5, 16.1, 6.5, 19.4, 6.5, 8.0, 19.6);
        barChar['C'] = new Array (6.5, 8.0, 6.5, 19.4, 6.5, 16.1, 19.6);
        barChar['*'] = new Array (6.5, 8.0, 6.5, 19.4, 6.5, 16.1, 19.6);
        barChar['D'] = new Array (6.5, 8.0, 6.5, 19.4, 19.6, 16.1, 6.5);
        barChar['E'] = new Array (6.5, 8.0, 6.5, 19.4, 19.6, 16.1, 6.5);
    this.SetFont('Arial','',13);
    this.Text(xpos, ypos + height + 4, codice);
    this.SetFillColor(0);
    codice = 'A'+codice.toUpperCase()+'A';
    for(i=0; i<codice.length; i++){
        char = codice.charAt(i);
        if (typeof barChar[char] === 'undefined') {
            this.Error('Invalid character in barcode: '+char);
        }
        seq = barChar[char];
        for(bar=0; bar<7; bar++){
            lineWidth = basewidth*seq[bar]/6.5;
            if(bar % 2 == 0){
                this.Rect(xpos, ypos, lineWidth, height, 'F');
            }
            xpos += lineWidth;
        }
        xpos += basewidth*10.4/6.5;
    }
}
var basewidth=0.35; var高度=16; var barChar=新数组(); barChar['0']=新数组(6.5,10.4,6.5,10.4,6.5,24.3,17.9); barChar['1']=新数组(6.5,10.4,6.5,10.4,17.9,24.3,6.5); barChar['2']=新数组(6.5,10.0,6.5,24.4,6.5,10.0,18.6); barChar['3']=新数组(17.9,24.3,6.5,10.4,6.5,10.4,6.5); barChar['4']=新数组(6.5,10.4,17.9,10.4,6.5,24.3,6.5); barChar['5']=新数组(17.9,10.4,6.5,10.4,6.5,24.3,6.5); barChar['6']=新数组(6.5,24.3,6.5,10.4,6.5,10.4,17.9); barChar['7']=新数组(6.5,24.3,6.5,10.4,17.9,10.4,6.5); barChar['8']=新数组(6.5,24.3,17.9,10.4,6.5,10.4,6.5); barChar['9']=新数组(18.6,10.0,6.5,24.4,6.5,10.0,6.5); barChar['$']=新阵列(6.5,10.0,18.6,24.4,6.5,10.0,6.5); barChar['-']=新阵列(6.5,10.0,6.5,24.4,18.6,10.0,6.5); barChar[':']=新数组(16.7,9.3,6.5,9.3,16.7,9.3,14.7); barChar['/']=新阵列(14.7,9.3,16.7,9.3,6.5,9.3,16.7); barChar['.]=新阵列(13.6,10.1,14.9,10.1,17.2,10.1,6.5); barChar['+']=新数组(6.5,10.1,17.2,10.1,14.9,10.1,13.6); barChar['A']=新数组(6.5,8.0,19.6,19.4,6.5,16.1,6.5); barChar['T']=新数组(6.5,8.0,19.6,19.4,6.5,16.1,6.5); barChar['B']=新数组(6.5,16.1,6.5,19.4,6.5,8.0,19.6); barChar['N']=新数组(6.5,16.1,6.5,19.4,6.5,8.0,19.6); barChar['C']=新数组(6.5,8.0,6.5,19.4,6.5,16.1,19.6); barChar['*']=新阵列(6.5,8.0,6.5,19.4,6.5,16.1,19.6); barChar['D']=新数组(6.5,8.0,6.5,19.4,19.6,16.1,6.5); barChar['E']=新阵列(6.5,8.0,6.5,19.4,19.6,16.1,6.5); 这个.SetFont('Arial','',13); 文本(xpos,ypos+高度+4,密码); 这个.SetFillColor(0); codice='A'+codice.toUpperCase()+'A';
对于(i=0;i首先,你用错误的标记发布了它:从外观上看,这像JavaScript或ASP.NET语言问题之一不是一个经典的ASP。其次,你的问题是什么?
this.Codabar=function Codabar(xpos, ypos, codice) {
        var basewidth=0.35;
        var height=16;
        var barChar=new Array();
        barChar['0'] = new Array (6.5, 10.4, 6.5, 10.4, 6.5, 24.3, 17.9);
        barChar['1'] = new Array (6.5, 10.4, 6.5, 10.4, 17.9, 24.3, 6.5);
        barChar['2'] = new Array (6.5, 10.0, 6.5, 24.4, 6.5, 10.0, 18.6);
        barChar['3'] = new Array (17.9, 24.3, 6.5, 10.4, 6.5, 10.4, 6.5);
        barChar['4'] = new Array (6.5, 10.4, 17.9, 10.4, 6.5, 24.3, 6.5);
        barChar['5'] = new Array (17.9,    10.4, 6.5, 10.4, 6.5, 24.3, 6.5);
        barChar['6'] = new Array (6.5, 24.3, 6.5, 10.4, 6.5, 10.4, 17.9);
        barChar['7'] = new Array (6.5, 24.3, 6.5, 10.4, 17.9, 10.4, 6.5);
        barChar['8'] = new Array (6.5, 24.3, 17.9, 10.4, 6.5, 10.4, 6.5);
        barChar['9'] = new Array (18.6, 10.0, 6.5, 24.4, 6.5, 10.0, 6.5);
        barChar['$'] = new Array (6.5, 10.0, 18.6, 24.4, 6.5, 10.0, 6.5);
        barChar['-'] = new Array (6.5, 10.0, 6.5, 24.4, 18.6, 10.0, 6.5);
        barChar[':'] = new Array (16.7, 9.3, 6.5, 9.3, 16.7, 9.3, 14.7);
        barChar['/'] = new Array (14.7, 9.3, 16.7, 9.3, 6.5, 9.3, 16.7);
        barChar['.'] = new Array (13.6, 10.1, 14.9, 10.1, 17.2, 10.1, 6.5);
        barChar['+'] = new Array (6.5, 10.1, 17.2, 10.1, 14.9, 10.1, 13.6);
        barChar['A'] = new Array (6.5, 8.0, 19.6, 19.4, 6.5, 16.1, 6.5);
        barChar['T'] = new Array (6.5, 8.0, 19.6, 19.4, 6.5, 16.1, 6.5);
        barChar['B'] = new Array (6.5, 16.1, 6.5, 19.4, 6.5, 8.0, 19.6);
        barChar['N'] = new Array (6.5, 16.1, 6.5, 19.4, 6.5, 8.0, 19.6);
        barChar['C'] = new Array (6.5, 8.0, 6.5, 19.4, 6.5, 16.1, 19.6);
        barChar['*'] = new Array (6.5, 8.0, 6.5, 19.4, 6.5, 16.1, 19.6);
        barChar['D'] = new Array (6.5, 8.0, 6.5, 19.4, 19.6, 16.1, 6.5);
        barChar['E'] = new Array (6.5, 8.0, 6.5, 19.4, 19.6, 16.1, 6.5);
    this.SetFont('Arial','',13);
    this.Text(xpos, ypos + height + 4, codice);
    this.SetFillColor(0);
    codice = 'A'+codice.toUpperCase()+'A';
    for(i=0; i<codice.length; i++){
        char = codice.charAt(i);
        if (typeof barChar[char] === 'undefined') {
            this.Error('Invalid character in barcode: '+char);
        }
        seq = barChar[char];
        for(bar=0; bar<7; bar++){
            lineWidth = basewidth*seq[bar]/6.5;
            if(bar % 2 == 0){
                this.Rect(xpos, ypos, lineWidth, height, 'F');
            }
            xpos += lineWidth;
        }
        xpos += basewidth*10.4/6.5;
    }
}