unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
        function  PTK_SetDarkness ( darkness:integer):integer;stdcall;external 'CDFPSK.DLL';
        function  PTK_SetPrintSpeed ( speed:integer):integer;stdcall;external 'CDFPSK.DLL';
        function  OpenPort    ( selection:integer):integer;stdcall;external 'CDFPSK.DLL';
        function  PTK_PrintLabel    ( number,cpnumber:Integer):integer;stdcall;external 'CDFPSK.DLL';
        function  PTK_DrawBarcode  ( px,py,pdirec:integer;typee:pchar;NarrowWidth,pHorizontal,pVertical:integer;ptext:char;pstr:pchar):integer;stdcall;external 'CDFPSK.DLL';
        Procedure ClosePort     ();stdcall;external 'CDFPSK.DLL';
        function  PTK_DrawTextTrueTypeW ( x,y,FHeight,FWidth:integer;FType:pchar;Fspin,FWeight,FItalic,FUnline,FStrikeOut:integer;id_name,data:pchar):integer;stdcall;external 'CDFPSK.DLL';
        Function GetErrState ():Integer;stdcall;external 'CDFPSK.DLL';
        function PTK_PcxGraphicsDel (pic:pchar):integer;stdcall;external 'cdfpsk.dll';
        function PTK_SetLabelHeight(lheight,gapH:Integer):integer;stdcall;external 'cdfpsk.dll';
        function PTK_SetLabelWidth(lwidth:Integer):integer;stdcall;external'cdfpsk.dll';
        function PTK_DrawText(px,py,pdirec,pFont,pHorizontal,pvertical:integer;ptext:char;pstr:Pchar):integer;stdcall;external 'CDFPSK.DLL';
        function SetPCComPort(BaudRate:Integer;HandShake:Boolean):integer;stdcall;external'cdfpsk.dll';
        function PTK_PcxGraphicsDownload(pcxname,pcxpath:pchar):integer;stdcall;external'cdfpsk.dll';
        function PTK_DrawPcxGraphics(x,y:Integer;gname:pchar):integer;stdcall;external'cdfpsk.dll';
        function PTK_DrawBar2D_Pdf417(x,y,w,v,s,c,px,py,r,l,t,o:Integer;LPTSTR:pchar):integer;stdcall;external'cdfpsk.dll';
 procedure TForm1.Button1Click(Sender: TObject);
begin
        OpenPort(1);
        //SetPCComPort(38400,TRUE);
        PTK_SetDarkness(10);
        PTK_SetPrintSpeed(4);
        PTK_SetLabelHeight(140,16);
        PTK_SetLabelWidth(500);

       PTK_DrawBarcode(10, 10, 0, '1', 3, 2, 60, 'B', pchar('ABCDEFG123456'));
       // PTK_DrawTextTrueTypeW (80, 50, 40, 0, pchar('Arial'), 1, 400, 0, 0, 0, pchar('AB'), pchar('PosteK Printer'));
       // PTK_DrawText (100, 100, 0, 3, 2, 2, 'N', Pchar('777weis4thhgjt7'));
        // PTK_DrawBar2D_Pdf417 (50, 250, 700, 600, 1, 0, 3, 16, 10, 8, 0, 0, pchar('1234567890ABCDEFGHIJKLMNOPQRSTUVWXY')); //仅仅支持机器版本号2.32以上的版本。
        PTK_PrintLabel(100, 1);
        ClosePort();
end;

end.


