Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Printing API Question

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi - I have a file coded in the native command language of the printer I need to print to. Its an Intermec Barcode printer and the file I have is in IPL language with all necessary data populated to print a barcode on the printer. I have this in file format bu of course can also get this as a string.

I want to send this string directly to the printer, i.e. as text direct to the printer. The printer is installed in Windows as a Generic/Text printer. When I use the print API, it forces me to define this as a type the printer supports, closest I can see is image/gif and then when I do this, the label does not print.

The data is correct because I can open a command prompt and type copy/b <filename> <printer> and it works fine.

Is what I am tying to do possible using the Java Print API? It seems like this forces the user into a series of steps defining document flavors other than just "printer command text", etc which I dont know but suspect is messing with my data prior to sending it. Is it possible to open a direct socket connection to a printer? Or do I have to use RunTime.exec and the copy command?

Any help would be greatly appreciated
 
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic