Simple Output to an HP LaserJet 1300 printer

Posted on 2005-04-08
Last Modified: 2010-05-18
I am looking for a simple character string I can use to pass to a printer.  It does not have to be anything fancy, something as simple as" hello world" across the top of the page.  I have looked through the HP references on the site and I am not able to put anything together.  Nothing I have been passing has seemed to work, and I am hoping with a known good string I can get the printer to print something.  I have a barcode scanner which will be connected serially and pass through a parallel converter before it gets to the printer.  So I will need a raw serial string or text string which I can convert to PCL Language that the printer will understand.
Question by:hedbusta
    LVL 13

    Expert Comment


    Older HP printers, and higher end models, had "PCL" and would also take ASCII text, so you could print to them just by sending them text ("Hello World" followed by a carriage return and line feed, and form feed to eject the page).

    However, the low end newer products don't take any high-level page description languages.  They are basically just "print engines", where all of what used to be done in the printer is now done in the computer by the printer driver.  The only thing passed to the printer is a string of "dots" (pixels) in a pure binary format (which isn't well documented for anyone who wants to do anything outside of the mfgr's print drivers).  This means, among other things, no printing from DOS.

    I'm not familiar enough with the LJ 1300 to say if that is the case with that model (that it has no high-level language capabilities whatsoever), but I suspect that this is the case.  I think that the higher-end printers still have full page description languages IN THE PRINTER, so your choice may end up being to change the printer, or to undertake a really complex software task.
    LVL 21

    Accepted Solution

    The LJ1300 is is a PCL and Postscript printer.
    It might be worth checking that the printer`s language is set to PCL as default, not Postscript

    A PCL page consists of ASCII  text  and bitmap images with PCL commands to set page size, font size, etc. , but if you send text without commands, it should print it out.
    you could try sending a reset code of escE (esc=escape, how you send that depends on your application)
    followed by  the set to PCL code, esc%0A  

    or the universal reset command:   esc%-12345X

    before your text string.

    From the sound of it, however, you are trying to connect a serial device directly to a parallel device without a PC, (just using a serial to parallel converter).
    For various reasons, this very unlikely to work.


    Author Comment

    Thank you both for your responses. Wylie I would like to know why this is unlikely to work.  I need to know if my attempts will be futile.  I imagined it is just data over the wire.  Is there somewhere I might need to find the correct initializer strings besides the escape character and setting the PCL Mode?  In the meantime I will try sending direct text and seeing if it will print out.  Thank you both again.

    Author Comment

    Wylie I tried it out and it does work with the string before it, however, it had to be followed by the escE as well or else I had to wait a few minutes for the printer to time out before it printed.  The string is below for reference.  Outputting that through the serial port will put the text on the page.  Simple.  Thanks again for all your help.

    hexadecimal 1B 45 1B 25 0A
    hexadecimal 0A 0D
    "printed material"
    hexadecimal 1B 45 1B 25 0A
    LVL 21

    Expert Comment

    Depends on the serial to parallel device, I expect.
     I have had generally poor results from serial/parallel/usb converters.
    Glad you managed to get it working:)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    This seems to be a very common error related to the Samsung printer driver. First, this is the error we're talking about: Log: System Type: Error Event: 7000 Agent Time: 3:37:24 am 22-Apr-09 Event Time: 6:07:24 pm 21-Apr-09 UTC Source: Se…
    Printers have changed substantially in the last 30 or so years, not just in technical capabilities but in cost and usage as well.  Printers were originally used for interfacing with the operator, not necessarily for printing copy or pictures. In …
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video discusses moving either the default database or any database to a new volume.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now