• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help start "Printer Manager" Project in Java  RSS feed

 
Mahar Qureshi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there,
I'm doing a project, the Print Manager that is supposed to do this:

1. Maintain users
2. Detect every print command, take username and password and then let normal printing to be done.
3. Maintain all user's print statistics like number of print outs, and time-stamp etc.

1 and 3 are easy i.e., create a database of users and their statistics and run SQL queries for corresponding manipulations. Step 2 is the gray area, where I know nothing.


I have the following main questions:

A. How to do step 2?
B. Which one to choose, NetBeans, Eclipse or what?
C. Which one to choose, Java EE, SE or what ?

Assumptions:
Print Manager is supposed to:
  • Be GUI
  • Provide functionality on standalone PC(s) with an attached printer
  • Has nothing to do with:
  • Network
  • Operating System users/accounts


  • Any help will be higly appreciated

    Regards.
     
    Jeanne Boyarsky
    author & internet detective
    Marshal
    Posts: 37462
    537
    Eclipse IDE Java VI Editor
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Mahar,
    Welcome to CodeRanch!

    Take a look at the Printer functionality in Java FX. This lets you print from Java and is part of Java SE.

    What IDE you use (Eclipse, NetBeans, etc) is up to you. That's just for editing your code and doesn't affect the functionality of the program.
     
    Andrea Binello
    Ranch Hand
    Posts: 62
    5
    Eclipse IDE Java Spring
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Mahar Qureshi wrote:2. Detect every print command

    What does it mean for you? Which print commands? Of all the applications in the operating system? E.g. you open Notepad on Windows and print a text file and you want that your Java application intercepts this print? This sounds very very complicated because if it is really possible, it certainly cannot be done in "pure" Java.
     
    Knute Snortum
    Sheriff
    Posts: 4270
    127
    Chrome Eclipse IDE Java Postgres Database VI Editor
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Andrea Binello wrote:
    Mahar Qureshi wrote:2. Detect every print command

    What does it mean for you? Which print commands? Of all the applications in the operating system? E.g. you open Notepad on Windows and print a text file and you want that your Java application intercepts this print? This sounds very very complicated because if it is really possible, it certainly cannot be done in "pure" Java.

    I think they mean every print command in the Java app, because:
    Mahar Qureshi wrote:Has nothing to do with:
    Network
    Operating System users/accounts
     
    Knute Snortum
    Sheriff
    Posts: 4270
    127
    Chrome Eclipse IDE Java Postgres Database VI Editor
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Mahar Qureshi wrote:B. Which one to choose, NetBeans, Eclipse or what?
    C. Which one to choose, Java EE, SE or what ? 

    B) I would choose Eclipse or IntelliJ -- but if you're going to develop a JavaFX app, maybe you'd like Netbeans' integrated SceneBuilder.

    C) Also depends: are you writing a simple GUI program?  Then Java SE should be fine.  I'd start there if you're a beginner. 
     
    Andrea Binello
    Ranch Hand
    Posts: 62
    5
    Eclipse IDE Java Spring
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Knute Snortum wrote:I think they mean every print command in the Java app

    Ok but .... if it is a "desktop" application (now it doesn't mind if Swing, JavaFX, etc..) what is the meaning of "detect"?

    If it is a desktop app, you developer provide a button, menu, etc to start a print. So you know when a printing is about to start .. there is nothing to "detect".
     
    Mahar Qureshi
    Greenhorn
    Posts: 5
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Jeanne Boyarsky wrote:Mahar,
    Welcome to CodeRanch!

    Take a look at the Printer functionality in Java FX. This lets you print from Java and is part of Java SE.

    What IDE you use (Eclipse, NetBeans, etc) is up to you. That's just for editing your code and doesn't affect the functionality of the program.


    Thanks Jeanne, I am now reading the printer API that you referred.
    By What IDE to use, I mean to know which IDE would be better for me as a beginner?

    Andrea Binello wrote:What does it mean for you? Which print commands? Of all the applications in the operating system? E.g. you open Notepad on Windows and print a text file and you want that your Java application intercepts this print? This sounds very very complicated because if it is really possible, it certainly cannot be done in "pure" Java.


    By "Detect" I exactly meant this. It is complicated indeed because it would be a desktop application and should know every print command from any application. How can I implement this?

     
    Knute Snortum
    Sheriff
    Posts: 4270
    127
    Chrome Eclipse IDE Java Postgres Database VI Editor
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Mahar Qureshi wrote:By What IDE to use, I mean to know which IDE would be better for me as a beginner?

    Some would say the best IDE for a beginner (on Windows) is Notepad++, which isn't an IDE at all, but an enhanced notepad app.  But I learned Java and the Eclipse IDE almost at the same time and didn't have any major problems.  Other IDEs are IntelliJ and Netbeans.  All are equally good (or bad) for a beginner.
     
    Knute Snortum
    Sheriff
    Posts: 4270
    127
    Chrome Eclipse IDE Java Postgres Database VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Mahar Qureshi wrote:By "Detect" I exactly meant this. It is complicated indeed because it would be a desktop application and should know every print command from any application. How can I implement this?

    I don't know, but it's not a beginner's project.  I'm not even sure Java is the best language for this task. 
     
    Paul Clapham
    Sheriff
    Posts: 22813
    43
    Eclipse IDE Firefox Browser MySQL Database
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Mahar Qureshi wrote:Hello there,
    I'm doing a project, the Print Manager that is supposed to do this:

    1. Maintain users
    2. Detect every print command, take username and password and then let normal printing to be done.
    3. Maintain all user's print statistics like number of print outs, and time-stamp etc.


    I don't know what operating system you plan to run this Print Manager on, but the idea that any operating system these days is going to be passing around user passwords is quite unlikely. Hopefully that's not an important part of the project.
     
    Mahar Qureshi
    Greenhorn
    Posts: 5
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Knute Snortum wrote:
    Mahar Qureshi wrote:By "Detect" I exactly meant this. It is complicated indeed because it would be a desktop application and should know every print command from any application. How can I implement this?

    I don't know, but it's not a beginner's project.  I'm not even sure Java is the best language for this task. 


    Ahan.. And as I'am a newbie, I should not go with this as my first Java Project?

    May someone suggest any amendment to this project to make it suitable for a beginner?
     
    Paul Clapham
    Sheriff
    Posts: 22813
    43
    Eclipse IDE Firefox Browser MySQL Database
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Well, you could write a service which accepts requests from Java applications, using an agreed-upon protocol, and converts those requests into printed output. But even that uses sockets and printing, which I wouldn't consider to be beginner topics in Java.
     
    Mahar Qureshi
    Greenhorn
    Posts: 5
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Paul Clapham wrote:Well, you could write a service which accepts requests from Java applications, using an agreed-upon protocol, and converts those requests into printed output. But even that uses sockets and printing, which I wouldn't consider to be beginner topics in Java.


    Thanks Paul Clapham.

    Well, does this mean that any project involving printing process will not be a beginner's java project?
     
    Andrea Binello
    Ranch Hand
    Posts: 62
    5
    Eclipse IDE Java Spring
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Mahar Qureshi wrote:It is complicated indeed because it would be a desktop application and should know every print command from any application.

    You cannot detect print operations in other applications (either Java or "native"). Not in general and not without knowing something very specific about an application.

    You may eventually interact with the print spooler. On Ms Windows the Win API has the Print Spooler API Functions. But these are "native" functions that are normally used by C/C++ applications. So you should be very well versed on C and/or C++ and on how to invoke these functions from Java using the JNI (Java Native Interface) specification or at least using the JNA library. And this is definitely not a thing for beginners/newbies.

    And on another Operating System (e.g. Linux) the printing system is certainly radically different. At this level (printing, print spooler, etc..), unfortunately there is nothing really "standard" about APIs, environments, etc.

    If you are a beginner, honestly, please choose another more reasonable project.
     
    Paul Clapham
    Sheriff
    Posts: 22813
    43
    Eclipse IDE Firefox Browser MySQL Database
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Mahar Qureshi wrote:Well, does this mean that any project involving printing process will not be a beginner's java project?


    Let's put it this way... the first time I tried to use Java code to print something I had many years of experience in Java, and I didn't find it easy. However when I looked at your suggested project I didn't even consider the code required to actually print something. You had enough other hard and impossible stuff without looking at that.
     
    Mahar Qureshi
    Greenhorn
    Posts: 5
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Andrea Binello wrote:
    Mahar Qureshi wrote:It is complicated indeed because it would be a desktop application and should know every print command from any application.

    You cannot detect print operations in other applications (either Java or "native"). Not in general and not without knowing something very specific about an application.

    You may eventually interact with the print spooler. On Ms Windows the Win API has the Print Spooler API Functions. But these are "native" functions that are normally used by C/C++ applications. So you should be very well versed on C and/or C++ and on how to invoke these functions from Java using the JNI (Java Native Interface) specification or at least using the JNA library. And this is definitely not a thing for beginners/newbies.

    And on another Operating System (e.g. Linux) the printing system is certainly radically different. At this level (printing, print spooler, etc..), unfortunately there is nothing really "standard" about APIs, environments, etc.

    If you are a beginner, honestly, please choose another more reasonable project.


    Thanks Andrea Binello

    I, now, realized the level of complexity that the printing process involves.

    I appreciate everyone's effort here. Thanks all.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!