Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Printer control

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Printer control

    I want to make a program that turns a printer to a typewriter: you type a character, it is printed immediately, the page only goes up when a line is finished and only a bit etc.
    The question is, is this possible to do with JAVA?
    a good programmer can write a Java program in any language


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Printer control

    you want the printer to print one character at a time, and pause until you type another character? As in the printer actually printing letter by letter upon keypress?

  3. #3
    Junior Member
    Join Date
    Sep 2010
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Printer control

    Quote Originally Posted by jps View Post
    you want the printer to print one character at a time, and pause until you type another character? As in the printer actually printing letter by letter upon keypress?
    Yes. I suspect it prints less than the hight of a chacarter, so the action might have to be more complicated than that, but basically yes.
    a good programmer can write a Java program in any language

  4. #4
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Printer control

    Quote Originally Posted by bardd View Post
    Yes. I suspect it prints less than the hight of a chacarter, so the action might have to be more complicated than that, but basically yes.
    That is what I thought you meant by your question...

    By printing less than the height of a character, you probably mean a more modern printer which makes several passes to complete the height of one line of text, and you would be correct.
    However, on that note, some printers that print in this manner (my inkjet for example), rolls the page up and down per section adding different colors with multiple side-to-side passes. To watch the page print, it moves up and down about 1/2" several times before scrolling to the next ~1/2" section.
    I am not very experienced in printers as far as your question goes, but I would guess it would be possible to do, however making it happen may force you to dig into the driver for the printer.
    Hopefully someone with more info can post details. I would like to know if it is possible myself.
    ...Not that I can think of a reason to do it, other than to say you did it, but I find it interesting just the same...

  5. #5
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Printer control

    Did you try reading PrinterJob JavaTM 2 Platform
    Std. Ed. v1.4.2
    ? And by using this, record Graphics on the printer. You must have to work a little to accomplish your requirements.
    Last edited by Mr.777; August 31st, 2012 at 09:31 AM.
    Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young. The greatest thing in life is to keep your mind young.

    - Henry Ford

Similar Threads

  1. direct output to printer
    By anandck in forum Java Theory & Questions
    Replies: 0
    Last Post: June 3rd, 2012, 04:52 AM
  2. Java Vierual Printer
    By abu_alfouz in forum Member Introductions
    Replies: 0
    Last Post: July 25th, 2011, 08:16 AM
  3. Java printer selection
    By pnvsgupta in forum Java SE APIs
    Replies: 4
    Last Post: July 23rd, 2011, 11:31 AM
  4. Replies: 0
    Last Post: April 8th, 2011, 09:17 PM
  5. How to print out data from web page to printer????
    By verma86 in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: April 2nd, 2010, 10:26 PM