wood burning stoves 2.0*
The moose likes Java in General and the fly likes Pring API suggestion needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Pring API suggestion needed" Watch "Pring API suggestion needed" New topic
Author

Pring API suggestion needed

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9384
    
    2

Guys,

I'm looking for some good API's for printing invoices kind of stuff in Java. Is there any good open source projects available?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41885
    
  63
So you're not really looking for a print API (which is provided by the JRE in the javax.print package), but for a library that creates invoices?


Ping & DNS - my free Android networking tools app
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9384
    
    2

Yes, kind of. If there is already an opensource solution available, it would be a good idea to use it. Any ideas?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

iText/JasperReports are typical PDF solutions.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9384
    
    2

I had a look at the CUPS API located at http://cups.org and initially I thought that it would be yet another framework implemented in Java but later upon browsing from the CUPS homepage, I saw all the API's written using C. In this sense I guess I should be using the JNI to couple this in my java programs. Any ideas on how I could use the CUPS api in my Java programs?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41885
    
  63
CUPS is a protocol for accessing printers, but it doesn't sound as if that's the problem you're trying to solve. Have you looked at David's suggestions? Do they meet your requirements? If not, what's missing?
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9384
    
    2

I'm just willing to know on how I could use CUPS to do some bulky printing tasks? It will be a Java application that will populate all the data needed for printing and I would like to know how I could design my Java component to use CUPS for this purpose?

The options mentioned by David is good but I'm not supposed to use them.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41885
    
  63
You still haven't said what exactly the requirements are. So far you stated that you're "kind of" looking for a library, and that iText and Jasper are helpful but you can't use them for some reason.

What, exactly, are you looking for, and what else is off the table? Where did this idea of using CUPS come from, and what do you think will it help you achieve that Java's built-in printing API doesn't?
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9384
    
    2

My requirement is kind of an invoice printing functionality and there may be couple hundreds of invoices that needs to be printed at a given point of time. I heard through one of my colleague that CUPS uses much less memory than the JPS api. Now the question here is, from a JPS perspective the usage is pretty straightforward. But if I happen to use CUPS for which the core api is written using c, what extra effort that I should put in order for my Java application to print those invoices?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

CUPS is almost certainly not what you're looking for. CUPS would be something that Java printing might *talk* to--for example, CUPS is what Linux uses (or at least used to) to manage its print jobs and printer drivers. A few hundred invoices isn't exactly a gigantic print job--what makes you think you need to do anything special? What OS are you running on? What issues are you trying to solve that you've had with the default solutions?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Pring API suggestion needed