Print success message but not sent to printer

598 views
Skip to first unread message

aaron

unread,
May 23, 2012, 3:43:23 PM5/23/12
to jzebra...@googlegroups.com
New to getting jzebra working.  I am having trouble trying to send a print job to an Epson 520 printer.  

I can use jzebra to print to a local file.  I cannot print to my printer on my Macbook (i get an error message  - "Exception occured: jzebra.PrintRaw.print() failed."

I tried uploading to my linux server.  The first time I tried, I got a printer success!  But nothing printed to my printer.  I have attached the log - looks like it should have printed.  The second time I tried, I got the "Exception occured: jzebra.PrintRaw.print() failed." message.  Am I doing something wrong?

Here is my attached JS.

 function print()  {

         var applet = document.jZebra;

         if (applet != null) {

            // Send characters/raw commands to applet using "append"

            // Hint:  Carriage Return = \r, New Line = \n, Escape Double Quotes= \"

            //applet.append("A590,1600,2,3,1,1,N,\"jZebra " + applet.getVersion() + " sample.html\"\n");

            //applet.append("A590,1570,2,3,1,1,N,\"Testing the print() function\"\n");

            //applet.append("P1\n");

            applet.append("\x1B\x40");  // 1

applet.append("\x1B\x21\x08");  // 2

applet.append("             International              \r\n");

applet.append("                Company                 \r\n");

applet.append("\x1B\x21\x01"); // 3

applet.append("   **************************************************   \r\n");

applet.append("Info:                                              42972\r\n");

applet.append("Info:                                              Kommm\r\n");

applet.append("Datum:                                       14:00 01/02\r\n");

applet.append("   --------------------------------------------------   \r\n");

applet.append("Info:                                              42972\r\n");

applet.append("Info:                                              Kommm\r\n");

applet.append("Datum:                                       14:00 01/02\r\n");

applet.append("   --------------------------------------------------   \r\n");

applet.append(" \r\n");

applet.append(" \r\n");

applet.append(" \r\n");

applet.append(" \r\n");

applet.append("\x1D\x56\x41"); // 4

applet.append("\x1B\x40"); // 5

            // Send characters/raw commands to printer

            applet.print();

            }

monitorPrinting();            

      }

jzebra.LogIt log - epson

Tres Finocchiaro

unread,
May 23, 2012, 9:56:07 PM5/23/12
to jzebra...@googlegroups.com
Aaron,

You code looks fine to me.

Is this a "Workforce 520 all-in-one" printer perhaps?

Make sure if you are sending ESC/P commands, such as \x1B, that your printer supports it.

If it does not, try following the tutorial for printHTML() which will work better with all-in-ones, deskjets, inkjets, laserjets, etc.

-Tres
--
To unsubscribe from this group, send email to jzebra-users...@googlegroups.com
 
http://code.google.com/p/jzebra


--
- Tres.Fin...@gmail.com
Reply all
Reply to author
Forward
0 new messages