Results 1 to 2 of 2
  1. #1
    Randy_Dennis is offline Member
    Join Date
    Mar 2009
    Location
    Alabama
    Posts
    4
    Rep Power
    0

    Default Passing escape codes to printers

    Hello All,

    Has anyone worked with sending printer escape codes to line printers (i.e. Epson DFX-8500). We use these printers to generate our shipping documents, etc. and we'd like to add barcodes to our Bill of Lading documents. I set perform the printer file setup in the following code example:

    /* Printer File Setup */
    SpooledFileOutputStream out;
    PrintParameterList printParms = new PrintParameterList();

    printParms.setParameter(PrintObject.ATTR_OUTPUT_QU EUE, outputQueue);
    printParms.setParameter(PrintObject.ATTR_FORMTYPE, "BOL");
    printParms.setParameter(PrintObject.ATTR_PRTQUALIT Y, "*DRAFT");
    printParms.setParameter(PrintObject.ATTR_CPI, charactersPerInch);
    printParms.setParameter(PrintObject.ATTR_LPI, linesPerInch);
    out = new SpooledFileOutputStream(system, printParms, null, null);
    scsWtr = new SCS3812Writer(out, 37, system);

    And use the following method to print:
    private void println(String str) throws IOException {
    scsWtr.write(str);
    scsWtr.newLine();
    lineCount++;
    }

    And we construct a StringBuffer to pass into the prinln method above:
    sb = new StringBuffer(getSpaces(CPL));
    sb.insert(0, centerBetween(0, 80,"Bill of Lading" + reprint));
    sb.setLength(CPL);
    println(sb.toString());

    What I'd would like to be able to do is to send an escape code to our DFX-8500 to set the printer to print barcode (I have the DFX manual and documentation to on the escape codes) but I'm having problems with the printer actually recognizing any escape code correctly. Any suggestions? Or is their any solutions that deal with generating and printing barcodes that don't deal with the awt or swing classes?

    Thanks,
    Randy

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Try googling for "java barcode library". You can probably use one of those to paint barcodes to send to a printer. Don't know about direct printer control though. Java's printer support tends to be rather simplistic.

Similar Threads

  1. Escape Sequence
    By Punter in forum New To Java
    Replies: 4
    Last Post: 02-10-2009, 07:04 AM
  2. Escape Sequence \t does not display.
    By dreamingofgreen in forum New To Java
    Replies: 7
    Last Post: 07-22-2008, 04:50 AM
  3. Scanners / Printers
    By cytech in forum New To Java
    Replies: 0
    Last Post: 03-17-2008, 05:54 PM
  4. Escape sequence problem
    By eva in forum New To Java
    Replies: 2
    Last Post: 01-21-2008, 10:15 PM
  5. Frog Escape 0.0.1 alpha
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 07-14-2007, 08:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •