附带了一个demo 里面有个小程序c++builder做的
只有一个exe程序剩下的是bpl文件和两个dll文件
 能够打印我从网上下载了些代码能够运行,可是打印出的东西没有条码,且是乱码我想做成delphi的 现在对这方面的东西没有什么概念,希望大家指点有没有这方面的完整例子??我的信箱是:[email protected]
多谢了

解决方案 »

  1.   

    用普通打印机打印code39的程序:
    //                                          
    //      -'`"_         -'`" \     
    //     /     \       /      "     
    //    /     /\\__   /  ___   \         
    //   |      | \  -"`.-(   \   |         
    //   |      |  |     | \"  |  |         
    //   |     /  /  "-"  \  \    |  CODE BY   bianzheng
    //    \___/  /  (o o)  \  (__/         
    //         __| _     _ |__  [email protected]     
    //        (      ( )      )         
    //         \_\.-.___.-./_/         
    //           __  | |  __     
    //          |  \.| |./  |     
    //          | '#.   .#' |     
    //          |__/ '"" \__|         
    //        -/ 2003.08.19  \-     
    //
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;namespace Flight
    {
    /// <summary>
    /// WebForm3 的摘要说明。
    /// </summary>
    public class WebForm3 : System.Web.UI.Page
    {
    protected System.Web.UI.WebControls.Label Label1;
    protected System.Web.UI.WebControls.Label Label2;
    protected System.Web.UI.WebControls.Label Label3;
    protected System.Web.UI.WebControls.Button Button1;
    protected System.Web.UI.WebControls.Panel Panel1;

    private void Page_Load(object sender, System.EventArgs e)
    {
    Label1.Text=Request.Params["_flight"]+"航班  "+Request.Params["_from"]+" 至 "+Request.Params["_to"];
    Label2.Text=Request.Params["_ys"]+"年"+Request.Params["_ms"]+"月"+Request.Params["_ds"]+"日       "+Request.Params["_time"]+"       "+Request.Params["_seat"]+"座位";// 在此处放置用户代码以初始化页面
    Label3.Text=Request.Params["_pwd"];
    //==========================================
    string s0="101001101101";
    string s1="110100101011";
    string s2="101100101011";
    string s3="110110010101";
    string s4="101001101011";
    string s5="110100110101";
    string s6="101100110101";
    string s7="101001011011";
    string s8="110100101101";
    string s9="101100101101";
    string sx="100101101011";
    string pw=Request.Params["_pwd"];
    string codestr;
    codestr="";
    int i;
    for (i=0;i<16;i++)
    if (string.Equals(pw[i],s0)) codestr=codestr+s0+"0";
    else if (string.Equals(pw[i],s1)) codestr=codestr+s1+"0";
    else if (string.Equals(pw[i],s2)) codestr=codestr+s2+"0";
    else if (string.Equals(pw[i],s3)) codestr=codestr+s3+"0";
    else if (string.Equals(pw[i],s4)) codestr=codestr+s4+"0";
    else if (string.Equals(pw[i],s5)) codestr=codestr+s5+"0";
    else if (string.Equals(pw[i],s6)) codestr=codestr+s6+"0";
    else if (string.Equals(pw[i],s7)) codestr=codestr+s7+"0";
    else if (string.Equals(pw[i],s8)) codestr=codestr+s8+"0";
    else if (string.Equals(pw[i],s9)) codestr=codestr+s9+"0";
    else codestr=codestr+sx+"0"; Response.Write("<table border=1 width=53% height=54>");
    Response.Write("<tr>");
    Response.Write("<td width=100% height=48>");
    for (i=0;i<206;i++)

    Response.Write("<IMG SRC=images/"+codestr[i]+".jpg WIDTH=2 HEIGHT=36>");

    Response.Write("</td>");
    Response.Write("  </tr>");
    Response.Write("</table>");
    Response.Write("");

    }


    #region Web Form Designer generated code
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {    
    this.Load += new System.EventHandler(this.Page_Load); }
    #endregion private void Button2_Click(object sender, System.EventArgs e)
    {
    Response.Redirect("frm_Book.aspx");
    }
    }
    }
      

  2.   

    现在打印机带的手册只是些commomd指令
    没有具体的函数,它附带的检测程序只是个exe文件,没有源代码可以查看现在上面要求用这台打印机,不要用普通打印机;打印机只是接受指令,内部算法
      

  3.   

    这个跟delphi没有关系,你需要Partner的驱动程序,因为Delphi只是生成报表,而由报表语句转成打印机原语要由驱动程序和操作系统协作来完成,如果驱动不对打印出来的就是乱码