Sending characters to the printer

Hello together,
we are trying to send raw data or control characters to a printer using the standard "Universal / TextOnly" printer driver in order to print barcode data on a special printer. This works fine by using Windows Notepad.
Unfortunately, Java only provides printing with a Graphics context. So we have not succeeded so far.
Has anyone else had the same problem and how did they overcome it?

Hi again.
This is distilled from the JavaCOMM API.
This code is changed from the example and looking at the docs for a minute. I don't know if it compiles but it should :-)
import java.io.*;
import java.util.*;
import javax.comm.*;
public class SimpleWrite {
    static Enumeration portList;
    static CommPortIdentifier portId;
    static String messageString = "Hello, world!\n";
    static ParallelPort parallelPort;
    static OutputStream outputStream;
    public static void main(String[] args) {
        portList = CommPortIdentifier.getPortIdentifiers();
        while (portList.hasMoreElements()) {
            portId = (CommPortIdentifier) portList.nextElement();
            if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) {
                // if (portId.getName().equals("LPT1")) {
                if (portId.getName().equals("/dev/lp0")) {
                    try {
                        parallelPort= ParallelPort
                            portId.open("SimpleWriteApp", 2000);
                    } catch (PortInUseException e) {}
                    try {
                        outputStream = parallelPort.getOutputStream();
                    } catch (IOException e) {}
                    try {
                        outputStream.write(messageString.getBytes());
                    } catch (IOException e) {}
}Hope this helps,
Nuno

Similar Messages

  • Can send characters to the standard input while DOS Command is under execution

    Can Labview send characters to the standard input while DOS Command is under running with System Exec.vi?

    iftu wrote:
    Found following VI's in ogpipe.llb under the ZIP file. Didn't find PING Example.vi
    OGPIPE Write To Pipe__ogtk.vi
    OGPIPE RefNum__ogtk.ctl
    OGPIPE Read From Pipe__ogtk.vi
    OGPIPE Open System Command__ogtk.vi
    OGPIPE Open Pipe__ogtk.vi
    OGPIPE Close Pipe__ogtk.vi
    OGPIPE - VI TREE__ogtk.vi
    PING Example is not in that archive. This is only the actual PIPE function library. What you want to do is using "OGPIPE Open System Command" to create the pipe handles for stdin and stdout and optinally stderr. Then use "OGPIPE Write To Pipe" to write to stdin and "OGPIPE Read From Pipe" to read from stdout and optionally stderr. When finished close each opened pipe handle with "OGPIPE Close Pipe".
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Ready to print. Now, how to send this to the printer?

    Hello Again,
    The little program is 5.5 x 8 inch pages (letter size paper folded in half). They must to
    print it in 4 pieces of paper letter size, put them together and then fold them in half, (staple it).
    I am using 1/4 inches in bleed and I would like to have crops marks. Must to be PDF!
    I have no idea how to send this to the printer. Any help?
    Thanks a lot!!
    Jesus

    First, ask your printer.
    Second, printers generally want unimposed PDF. IOW, export regular pages and let your printer arrange them the way they want it.
    But definitely ask them first. And make sure you mention the bleed.
    Ken Benson

  • REP-1885 Can't send output to the printer

    I got the error: REP-1885 Can't send output to the printer
    when trying to print a report from Live Previewer.
    Report Builder: 6.0.8.19
    Oracle 8.1.7.2
    Any help is much appreciated.

    hello,
    i'd try the latest patchset and if that does not help, contact oracle support services.
    regards,
    philipp

  • How to use HyperTerminal to send characters to the cRIO

    Hello, I built an RS232 serial cable using three wires interface of serial port (Rx, TX, GND). And I connected it between my computer and the cRIO. I would like to ask is it possible to use HyperTerminal to send characters to the cRIO? What vi. do I need to do so?
    And is my cable interface correct? Do I need to connect other pins besides Rx, TX and GND?
    Thank you very much for helping.

    So did it or did it not work when you typed words in by hand in hyperterminal?  I'm not clear on this from your response.
    What kind of things are you trying to send?  What code do you have on your SBRIO to handle the other end of the communication.
    It could mean your connection failed.  It could mean you have the wrong cable between the two (null modem vs. straight through), it could mean you aren't sending the data in the same way the code on the RIO is expecting.  Look at such things like any termination characters you send at the end of the message.
    It's kind of hard to help without know more details of what you are trying to do and whether it is working for you in Hyperterminal or not.

  • Is Lightroom sending sRGB to the printer driver?

    Hello,
    I've been trying to print something on a color laser printer with Lightroom. Unfortunately, Lightroom doesn't seem to support the profile of the printer, maybe it's a CMYK profile, and so I had to use the option "Profile: managed by printer" in Lightrooms print module.
    In order to set up the printer driver correctly and let him handle the color management, I'd like to know what Lightrooms sends to the printer driver when the option "managed by printer" is set (and when draft mode is off!)
    Thanks in advance

    Jeff Schewe - 12:08am Jan 1, 08 PST (#2 of 8)
    Version 1.0 sent sRGB
    Uh, no...since the beta process, when not using draft mode, Lightroom ALWAYS sent ProProto RGB. Draft mode will send either sRGB or Adobe RGB depending on the settings for the previews.
    Since the OP is printing to a laser printer as opposed to a photo printer, the best bet would be to print using draft mode anyway.
    Jeff,
    You may be right and I am sure you know more about this than I do, but in 1.0 I could print contact sheets to my laser printer with no problems with "managed by printer" selected and draft mode off. Since 1.1 I have not been able to get acceptable results regardless of whether I choose draft mode or not and regardless of the settings in the export module. I would love to solve this as it is the number 1 issue I have with Lightroom.
    Gordon

  • Explorer Context Menu Convert Sends Files to the Printer

    Right-clicking PSD files and choosing "convert to PDF" sent the files to the printer!!!  I had hoped it would have brought up a dialog to convert the files to PDF...
    (I was looking for "combine as PDF" -- I'm not sure what happened to it?)
    I'm running Acrobat 11 on Windows 8.1
    -Donald

    All that context menu stuff is handled by the registry. The explorer application simply gets its information from there. So Labview can write to a registry key to add itself to handle a file type. This is why you can have multiple applications handle the same type and show up in the context menu.
    My point is that after I run LV 8.0, I will see both LV 8.2 and LV8.0 in the context menu (along with a couple of others). However, after I run LV 8.2, the LV8.0 option is removed. I'm guessing that this is related to a program's behavior in checking and setting the registry key to make sure that it is the default handler for the appropriate file types. NI would need to strengthen this code to be sensitive to previous versions of Labview.
    A rough example of how to do this is at  http://www.codeproject.com/w2k/extendingshell.asp
    Brian Rose

  • How do i send documents to the printer

    when I try to print a saved document I can not find how to swnd it to the printer

    Locking this thread, so any replies go to https://support.mozilla.com/en-US/forum/1/672706 :-)

  • How to send a report DIRECTLY to the printer (Linux App. Svr.)?

    Here is the problem:
    -- We have Windows clients / Linux App Server / Forms 10g R2.
    -- Printers are attached to the Windows clients.
    -- When we want to send DIRECTLY to the printer, we have to write data into a text file (using TEXT_IO) &
    -- print the same using command HOST('lp -d '||<printer IP of logged in user>t||' '||<file name>,NO_SCREEN).
    -- Our normal reports are displayed as PDFs.
    Is there a way to directly send the PDF to the printer without having to re-write the report to a text file?? Then we can just use the PDF output and don't have to do any code changes (i.e. redo every report).
    Edited by: user12240205 on May 16, 2011 5:59 AM
    Edited by: user12240205 on May 16, 2011 5:59 AM

    InoL wrote:
    Use destype=printer.
    The printer on the Windows client has to be defined as a network printer and be known on the Linux server.
    Other options:
    - use the orarrp utility
    - if you call your Reports from Forms, you can use a Java bean
    http://forms.pjc.bean.over-blog.com/article-6621538.html
    Thank you for the quick response. Can u please tell us how to make the printer "known" as a Linux server?? Will a normal network admin know how to do this or is it an Oracle developer's task?

  • How do I send email and web pages to a shared printer on home network. I verified that I can send documents to the shared printer.

    My home network (one wireless computer using Windows 7--the other using Windows XP) share a printer, but I can't send web pages or email to the shared printer. I can send documents to the printer, so I know that connection is set up properly. Could Firefox be blocking this function? If so, how do I configure it. Both computers use Firefox exclusively.
    == I never could share the printer when on websites.

    Locking this thread, so any replies go to https://support.mozilla.com/en-US/forum/1/672706 :-)

  • My Character Report don't send printer codes to the printer

    Hi every one !
    I am developing an ASCII report, I made my own prt file for my printer, I defined my width ... etc.
    I want to print bold characters in the printer and configured the printers code in the report (before and after), I put the "codes" in my prt file but the printer don't print in bold. I tryed using RWRUN60 from the command line but is the same.
    I put the printer in Data Dump Mode to review all the data in the printer's buffer and what is receiving. The printer is not receiving the printers codes.
    What is grong ?
    Can Some body help me ?
    Thanks,

    Robin:
    Thanks for the tip. I tryed that and don't work.
    I did a change in the report layout and print in doble wide that i wanted in bold.
    Other issue was the "NAME" of the code, in my case, the name of the code works with numbers not with a name.
    After many, many tries, this is a copy of my prt file for my printer that works !
    printer "rdsp"
    height 22
    width 80
    before report esc "x0"
    return control(M)
    linefeed control(J)
    after page control(J) esc "@"
    code "12" esc "!1"     
    code "56" esc "!M"
    code "999" esc "@"
    !1 = doble wide+doble strike+12 cpi Master select(!) and then 49 (the
    ASCII code of character 1)
    = ESC ! 1 or 27 33 1 or 1B 21 1 or [21 1
    @ = Initialize printer
    This is the only thing that it works !!!!
    Thanks

  • I'm running 10.5.8, trying to print from Word 08 to a HP C5180 all in one, getting random text along top of first page then the printer keeps feeding paper through.

    I downloaded the driver and software from HP for my OS, during installation it says HP Monitor Tray? quit unexpectedly, then it says installed successfully.  I opened Word 08 for Mac, typed a test page, hit print, and the first page came out with three lines of words and numbers, then the printer continued to feed blank sheets through?  I tried printing from TextEdit and it says "Textedit quit unexpectedly." Please help, I am new to the Mac and this is driving me nuts.  Thanks.

    That happens when the printer driver sends binary when ASCII or something else is expected. It ususally means the driver is goofed up.
    If this is an inkjet all-in-one, most of those are "dumb" printers that have a "monolithic" driver that does the imaging on the Mac, then sends the bitmap to the printer.
    The default for Mac OS X Printers is to send Postscript to the printer. So if there was any trouble installing the driver or setting up the Printer, it would end up a generic postscript, and that would go badly.

  • Sending a PDF to printer

    Hi,
    I have a requirement to send the PDF file to the printer/spool in my BADI implementation.
    I have generated the pdf file using web service, got it converted to binary/byte stream. Now i want to send that to the printer for printing.
    Please help me out with any function module / method for the same.
    Thanks
    Manish Mittal

    Hi,
    For smartform I was able to send it to the printer by settign the following:
        str_control_parameters-preview = ' '.
        str_output_options-tddest = l_outputdevice.
        str_output_options-tdnewid = 'X'.
        str_output_options-tdimmed = 'X'.
    Arash

  • Connecting with the printer

    I can't send documents to my printer to print because my laptop says that the printer is 'offline'. However when I check the connection on the printer itself it says that it's connected to wifi. But my laptop still can't send documents to the printer. (HP Officejet Pro 8500A Plus). How can I solve this? 

    Hi sophie96,
    Welcome to the HP Support forums.  I gather that when trying to print to your Officejet Pro 8500A Plus printer that you are getting an error message indicating that the printer is offline.
    I have included the Print Jobs are Stuck in the Print Queue document.  Each operating system has its own section.  Please click on your operating system and follow the steps to get the printer back online.
    Regards,
    Happytohelp01
    Please click on the Thumbs Up on the right to say “Thanks” for helping!
    Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
    I work on behalf of HP

  • How do a print a PDF of a brochure that the printer can use to print from?

    I have a brochure that is in color .... I want to print it in brochure format as a high quality pdf and then send it to the printer ... he will then use it to print the brochure.
    How do I do it?

    From the File menu, choose Export. Choose PDF and the type of PDF you desire to create on that dialog box.
    PDFX-1a and PDFX-4 are safe bets for your job. If your job has elements that bleed off the page, make sure you look at the section for printers marks, and that crop marks is set, along with any other options your printer specifies (like page info, color bars, etc).
    Take care, Mike

Maybe you are looking for