1

As i read in some fingerprint manual we can send text file to the printer. Means we can write the program in the text editor and send the whole program as a text file to the printer using the communication program using some transfer commands. for in my host there is a file called myfile.txt in D:/ with the fallowing data

10 PRPOS 200,200
20 DIR 3
30 ALIGN 5
40 PRIMAGE “GLOBE.1”
50 PRINTFEED
RUN

How can i send this file to printer and execute the instrucations to print the image. Please give me some code reference.

user1912935
  • 361
  • 4
  • 13
  • 34

3 Answers3

3

There are several ways to do this from the command line. For example:

type foo.txt > lpt1:

Or

copy foo.txt lpt1:

Or

print foo.txt

Or

notepad /p foo.txt

If you need to do it programmatically, you can execute any of those commands using the system() function or CreateProcess().

Carey Gregory
  • 6,836
  • 2
  • 26
  • 47
0

If you're on an Intermec handheld and you're connected to a Bluetooth printer, you should be able to open a serial port to COM6 and send your file over. What programming language? There should be plenty of Serial Port communication code examples out there.

IowaEric
  • 68
  • 5
0

My experience with Intermec PM4i label printer was a roller coaster but know I have a working app.

I tried Windows printer pipeline through generictext driver. It does work from Notepad but with few corner cases.

Printing directly from Notepad works fine until I tried QRCODE image with a very long text line. Image did not print out. Made qrcode text a short few characters and same script worked fine.

INPUT OFF
NASC 1252
BF OFF
FT "Swiss 721 Bold BT",12,0,100 
PP 50,500:PT "Text line goes here"
PP 400,400:AN 7:BARSET "QRCODE",1,1,7,2,4
PB "ABC123 aabbcc....very long text goes here...I mean about 200 chars or more"
PRINTFEED

It was like Notepad cut text to a right side border and command string was broken. I made a printing preferences A3-landscape and it accepted longer text but still was not enough for all use cases.

All printers have a physical max printing width but it should not be considered in a fingerprint/directprotocol script files. After all we are not printing this text as-is but submitting commands to the printer.

My solution was to create Java application which opens a raw TCP socket to 11.22.33.44:9100 address and writes text lines, lines terminated by NL(#10). Works fine. Another helper tool I did was Delphi app.exe to read IP address from Windows printer object. I can submit label printouts "directly" from Excel application.

  • End users edit Excel data rows and click PRINT LABELS button
  • vba macro parses a fingerprint template file with ${FIELD1} find-and-replace substitutes
  • file is written to %wintemp%/intermec_script.txt folder
  • call app.exe to read IP address of user chosen printer
  • call java app to submit intermec_script.txt to IP:PORT socket

I should create same socket submit app in Delphi to drop javavm dependency but this solution was faster for my use case. I am more familiar with Java than my Delphi skill level.

Whome
  • 10,181
  • 6
  • 53
  • 65