Note that there are some explanatory texts on larger screens.

plurals
  1. POSending printer specific commands
    primarykey
    data
    text
    <p>I have an issue here, which I am trying to encode magnetic stripe data to an Fargo DTC400 printer, in the specifications it says I need to send the following string commands from example notepad, wordpad etc etc : </p> <pre><code>~1%TRACK NUMBER ONE? ~2;123456789? ~3;123456789? </code></pre> <p>this example encodes the string in track one, and the numbers 123456789 in both track 2 and 3.. this works from Notepad.exe.</p> <p><strong>EDIT:</strong> Current delphi code I use works on another printer: </p> <pre><code>procedure SendQuote(MyCommand : AnsiString); var PTBlock : TPassThrough; begin PTBlock.nLen := Length(MyCommand); StrPCopy(@PTBlock.SData, MyCommand); Escape(printer.handle, PASSTHROUGH, 0, @PTBlock, nil); end; </code></pre> <p>when I am trying to encode this string from my own application I get trouble, it seems the printer is totally ignoring my commands, when I choose print to file, I can read the binary data and see my string in the printed file, when I try to print to file from example notepad.exe I get just rubish binary data and cannot find my strings at all...</p> <p>so I wonder what does notepad do to send this string command which I dont ?</p> <p>hope someone can shed light on this because I have been eager to implement fargo support in my application for a longer period of time . </p> <p>thanks</p> <p><strong>Update.</strong> the following code is ancient but it does the job, however is there another way I can use this with the Passthrough code above?</p> <pre><code>var POutput: TextFile; k: Integer; begin with TPrintDialog.Create(self) do try if Execute then begin AssignPrn(POutput); Rewrite(POutput); Writeln(POutput,'~1%TESTENCODER?'); Writeln(POutput,'~2;123456789?'); Writeln(POutput,'~2;987654321?'); CloseFile(POutput); end; finally free; end end; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload