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 2 of 2

Thread: reverse line feed using java printing

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default reverse line feed using java printing

    hi,
    i use java printjob here to print the invoice data.i need to reverse feed the printer using java code to move up.I heard about ASCII character code to reverse feeding a char.And By the by how to Use those ASCII codes to reverse feed the lines.i need to line feeder here to jump to the previous line.The code i use for printjob is included below.
    Thanks in Advance



    Public void doPrintJob() {

    PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
    DocPrintJob printerJob = defaultPrintService.createPrintJob();
    File psFile = new File("/tmp/postscriptexample.ps");
    SimpleDoc simpleDoc = null;

    try {
    simpleDoc = new SimpleDoc(psFile.toURL(), DocFlavor.URL.AUTOSENSE,null);
    } catch (MalformedURLException ex) {
    ex.printStackTrace();
    }
    try {
    printerJob.print(simpleDoc, null);
    } catch (PrintException ex) {
    ex.printStackTrace();
    } finally {
    File file = new File("/tmp/postscriptexample.ps");
    file.deleteOnExit();
    }

    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,913
    Thanks
    55
    Thanked 2,351 Times in 2,322 Posts

    Default Re: reverse line feed using java printing

    Can you plan ahead so that you never print a line that has to be changed afterwards?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 9
    Last Post: February 26th, 2013, 11:36 AM
  2. Replies: 11
    Last Post: November 12th, 2012, 01:09 PM
  3. Replies: 2
    Last Post: September 8th, 2011, 10:50 PM
  4. How to Read a file line by line using BufferedReader?
    By JavaPF in forum File Input/Output Tutorials
    Replies: 0
    Last Post: May 19th, 2008, 07:32 AM
  5. How to Read a file line by line using BufferedReader?
    By JavaPF in forum Java Code Snippets and Tutorials
    Replies: 0
    Last Post: May 19th, 2008, 07:32 AM