Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Did anyone ever use cups4j?

 
zhong zero
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found CUPS4J a few days ago. It's an open source library for ipp print. And I want to use it in my application.
Its site only show a C/S version example. And I want to use without the server.
Did anyone try this? If so,can you show me an example.

By the way,are there other libraries that provide ipp print API except javax.print and cups4j?
 
Bart Mc
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Little late to the party but I found your post looking for a sample, I have a simple USB printer that i pass raw ESC/P (Epson printer language files) to on a linux machine.
Its about as simple as it gets in terms of printing. javax.print was the other option, it seems to try to do too much and mess up my esc/p files.

So, here's a simple example to print a file via CUPS through java.

CupsClient cc = new CupsClient();
CupsPrinter cp = cc.getDefaultPrinter();
InputStream is = new FileInputStream("/home/bart/real.escp");
org.cups4j.PrintJob pj = new PrintJob.Builder(is).build();
cp.print(pj);


--
Bart
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic