You can buy the source code for Virtual Printer Driver. The price varies depending on whether you have permission to distribute the Virtual Printer Driver source code with your products' source code. Main Conditions. Quote > While I am aware that programs are not able to communicate directly to a > USB port (i.e. USB001), I need the ability to send RAW text to a Zebra > thermal label printer. This ability continues to work for LPTx/COMx in > Windows XP/2000+. Virtual Printer Driver Delphi Source Files> Is there any way that I can print directly to a printer using a TPrinter > object without any processing on the data stream just like a typical port? You can use Joe Hecht's PRTRAW unit: Dan. Hi Tom, I created something similar myself after a heavy dose of googling. Basically, I bought one of the raw print utilities because I could not get anything to work, and then figured out my issues within an hour. Very typical:) I needed a tool to package and send Toshiba label printer documents over the internet as email attachments and then print them directly to the printer via an IP. The driver I setup in Windows was a simple text printer. The issues I had were ultimately related to some EBCDIC/ASCII conversion issues of the control code characters. Here is my print routine: procedure TfrmRaw.btnPrintClick(Sender: TObject); var Handle: THandle; N: DWORD; DocInfo1: TDocInfo1; begin // sPrinter is set in a Printer Select dialog if not OpenPrinter(PChar(sPrinter), Handle, nil) then begin ShowMessage('error ' + IntToStr(GetLastError)); Exit; end; with DocInfo1 do begin pDocName:= PChar('CELSTEC'); pOutputFile:= nil; pDataType:= 'RAW'; end; StartDocPrinter(Handle, 1, @DocInfo1); StartPagePrinter(Handle); // In my case I was dumping some printer control codes from a text file to the printer by way of a Memo control. WritePrinter(Handle, PChar(memFile.Text), Length(memFile.Text), N); EndPagePrinter(Handle); EndDocPrinter(Handle); ClosePrinter(Handle); end; Hope this helps, David. Quote > While I am aware that programs are not able to communicate directly to a > USB port (i.e. USB001), I need the ability to send RAW text to a Zebra > thermal label printer. This ability continues to work for LPTx/COMx in > Windows XP/2000+. Another approach is to 'net use' the printer. First, share the printer on the network Then on the command line, type: net use lpt1 //path/to/printer You can then access it as if it was lpt1 and write out the raw data using assign(), rewrite(), etc. I used the technique recently for some point of sale printers and it worked perfectly. You can make it a permenant link by adding /persistent:yes to the net use command. Just note that this technique only works on PCs that are connected to a network. If the PC is destined to be a stand alone machine, the net use will fail. Windows Virtual Printer DriverSince Word (Microsoft) determines what is the 'raw' contents of a.DOC file it knows how to print.DOC files. The same applies for any 'known' file type holding some printable information. Free Download Virtual Printer DriverWhat if you need to print various types of documents / files from your application? Can you know how to send the file to the printer in order for it to be printed correctly? I guess the answer is no. At least I do not know:) Print Any Type of Document (PDF, DOC, XLS, HTML, RTF, DOCX) Using DelphiSo, how do you print any type of document, programmatically using Delphi code? Well I guess we should 'ask' Windows: what application knows how to print, for example, a PDF file. Or even better we should tell to Windows: here's one PDF file, send it to the application associated / in charge of printing PDF files. Open up Windows Explorer, navigate to a directory containing some printable files.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2018
Categories |