我的打印机没有安装驱动,用厂家的演示程序可以打印 ,我也有厂家的指令集,但不知道怎样发送。那位兄弟可以帮帮我,马上结贴~~

解决方案 »

  1.   

    CreateFile('LPT1',......)
    WriteFile(.....) // Your printer instruction here.
    CloseHandle()
    另外, 可否给我厂家的指令集?
    [email protected]
      

  2.   

    uses printer;var
      f:TextFile;
    begin
       Assignprn(f);
       {$I-}
        rewrite(f);
       {$I+}
        if ioresult=0 then
        begin
            //打开成功
            {$I-}
            Writeln(f,'Print Test');
            Write(f, chr($0B)+char($09));//你的控制码
            {$I+}
            if ioresult=0 then
            begin
               // ShowMessage('打印完成');
            end;
        end;
       {$I-}
        flush(f);
        closefile(f);
       {$I+}
    end;
      

  3.   

    哦哦,笔误“Write(f, chr($0B)+char($09));//你的控制码”
    Write(f, chr($0B)+chr($09));
      

  4.   

    Following are the functions used to print. AbortDoc
    DeviceCapabilities
    EndDoc
    EndPage
    Escape
    ExtEscape
    SetAbortProc
    StartDoc
    StartPageFollowing are the functions used to access the print spooler. AbortPrinter
    AbortProc
    AddForm
    AddJob
    AddMonitor
    AddPort
    AddPrinter
    AddPrinterConnection
    AddPrinterDriver
    AddPrintProcessor
    AddPrintProvidor
    AdvancedDocumentProperties
    ClosePrinter
    ConfigurePort
    ConnectToPrinterDlg
    DeleteForm
    DeleteMonitor
    DeletePort
    DeletePrinter
    DeletePrinterConnection
    DeletePrinterData
    DeletePrinterDriver
    DeletePrintProcessor
    DeletePrintProvidor
    DocumentProperties
    EndDocPrinter
    EndPagePrinter
    EnumForms
    EnumJobs
    EnumMonitors
    EnumPorts
    EnumPrinterData
    EnumPrinterDrivers
    EnumPrinters
    EnumPrintProcessorDataTypes
    EnumPrintProcessors
    FindClosePrinterChangeNotification
    FindFirstPrinterChangeNotification
    FindNextPrinterChangeNotification
    FreePrinterNotifyInfo
    GetForm
    GetJob
    GetPrinter
    GetPrinterData
    GetPrinterDriver
    GetPrinterDriverDirectory
    GetPrintProcessorDirectory
    OpenPrinter
    PrinterMessageBox
    PrinterProperties
    ReadPrinter
    ResetPrinter
    ScheduleJob
    SetForm
    SetJob
    SetPort
    SetPrinter
    SetPrinterData
    StartDocPrinter
    StartPagePrinter
    WaitForPrinterChange
    WritePrinter
      

  5.   

    具体用法可以查一查MSDN
    如果还有什么不懂,再贴出来!
      

  6.   

    我的代码测试正确:
    function  TFixtureControl.Print(Content:string):Boolean;
    var
      MYFile:TextFile;
    begin
      try
        Assignfile(MyFile,'lpt1');
        Rewrite(MyFile);
        Writeln(MyFile,Content);
        System.CloseFile(MyFile);
      except
      end;
    end;