#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    7
    Rep Power
    0

    Work With Usb Port Printer


    Hi,
    I have a delphi application which uses TASCIIPRINTER component to print the ZPL files using paralle ports. I need to migrate my application to Windows7 platform which works with USB port printers. Can you please help me in this.

    Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    151
    Rep Power
    2
    If TAsciiPrinter works through printer drivers (I suspect through "raw" mode), then you should not be having major problem. Just set it to correct printer and you should be okay.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    7
    Rep Power
    0

    Thanks


    Ok. I will check. Can i know your email id?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    151
    Rep Power
    2
    Sent through pm.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    7
    Rep Power
    0

    Hi Lufti


    Hi, Can i get some sample projects which will help me to understand on how to print files using USB printer?

    Thanks
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    151
    Rep Power
    2
    There is no significant difference between usb printer and paralel printer from Windows application point of view.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    7
    Rep Power
    0
    I have a print dialog, through which i selected the Zbra printer. I tried to pass the string as shown in the below code to Zebra printer. But it doesnt print anything.

    if printDialog.Execute then
    begin
    try

    myPrinter := Printer;
    try
    with myPrinter do
    begin
    // Start printing
    BeginDoc;
    myCommand := '^FT78,76^A0N,28,28^FH\^FDHello\nWorld^FS' ;
    +#13+#10+
    '^FT78,78^A0N,28,28^FH\Hello^FS ^FT78,110^A0N,28,28^FH\World^FS' +#13+#10

    if Escape(myPrinter.Canvas.Handle,
    PASSTHROUGH,
    Length(myCommand ),
    PAnsiChar(myCommand ),
    nil) = 0 then
    ShowMessage('Command error: ' + IntToStr(GetLastError));
    EndDoc;
    end;
    finally

    end;
    except
    on E: exception do
    begin
    showmessage(E.Message);
    end;
    end;
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    7
    Rep Power
    0
    I have a print dialog, through which i selected the Zbra printer. I tried to pass the string as shown in the below code to Zebra printer. But it doesnt print anything.

    if printDialog.Execute then
    begin
    try

    myPrinter := Printer;
    try
    with myPrinter do
    begin
    // Start printing
    BeginDoc;
    myCommand := '^FT78,76^A0N,28,28^FH\^FDHello\nWorld^FS' ;
    +#13+#10+
    '^FT78,78^A0N,28,28^FH\Hello^FS ^FT78,110^A0N,28,28^FH\World^FS' +#13+#10

    if Escape(myPrinter.Canvas.Handle,
    PASSTHROUGH,
    Length(myCommand ),
    PAnsiChar(myCommand ),
    nil) = 0 then
    ShowMessage('Command error: ' + IntToStr(GetLastError));
    EndDoc;
    end;
    finally

    end;
    except
    on E: exception do
    begin
    showmessage(E.Message);
    end;
    end;
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    7
    Rep Power
    0

    ZPL printing through Delphi Code


    With the use of Print dialog i am selecting the ZPL printer to print a ZPL command. Below is the code.

    ***************************************************

    if printDialog.Execute then
    begin
    try
    myPrinter := Printer;
    try
    with myPrinter do
    begin
    // Start printing
    BeginDoc;
    Canvas.Font.Size := 9;
    Canvas.Font.Color := clRed;
    Canvas.TextOut(200, 300, '^FO120,108^FDA Guide to^FS');
    Canvas.TextOut(200, 100, '^CF0,30');
    EndDoc;
    end;
    finally
    FreeAndNil(myPrinter);
    end;
    except
    on E:exception do
    showmessage(E.Message);
    end;
    end;

    ***************************************************



    I am getting the above full string as an output. As i am printing to a Zebra printer, the command i pass in the string should be parsed and it should output only the "A Guide to" in the label.



    Please help on how to fix this issue.

IMN logo majestic logo threadwatch logo seochat tools logo