Problems to print a simple test

651 views
Skip to first unread message

Leandro Gregolin

unread,
Aug 29, 2012, 12:53:01 AM8/29/12
to jzebra...@googlegroups.com
Hi.
I'm having problems to print a simple (and the first) test with jZebra.
I'm using OSX Lion (Cups 1.6) and a TLP 2844.
When I try to print something I receive this error message in Cups:

Unable to convert PostScript file

But my content is simple text, like:

   <script type="text/javascript">
      function print() {
         var applet = document.jZebra;
         if (applet != null) {
            applet.append("I8,A,003\n");
            applet.append("Q799,024\n");
            applet.append("q800\n");
            applet.append("rN\n");
            applet.append("S4\n");
            applet.append("D10\n");
            applet.append("ZT\n");
            applet.append("JF\n");
            applet.append("R16,0\n");
            applet.append("N\n");
            applet.append("A733,373,2,2,2,2,N,\"TEST\"\n");
            applet.print();
      }
      }
   </script>
   
   <applet name="jZebra" code="jzebra.PrintApplet.class" archive="./jzebra.jar" width="100" height="100">
      <param name="printer" value="zebra">
      <!-- <param name="sleep" value="200"> -->
   </applet><br><br>

   <input type=button onClick="print()" value="Print"><br>


Where is the problem? If I send the same EPL commands by terminal it prints fine.
Thanks.

Tres Finocchiaro

unread,
Aug 29, 2012, 1:24:39 AM8/29/12
to jzebra...@googlegroups.com
I'm not sure of the solution, but this problem was reported by another person here is the link:

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



--
- Tres.Fin...@gmail.com

Leandro Gregolin

unread,
Aug 29, 2012, 1:54:40 AM8/29/12
to jzebra...@googlegroups.com
The problem is the same, but without solution there.
I've seen it before my first message, and because that I said I'm printing only text, no pdf, no images or something like that.
If I try printing by terminal it works fine (the same commands below). My problem is only when I use jzebra. It's strange, but true :-)
Just a change: my OS is mountain lion and my printer is connected by USB.
Thanks.

Sent from my iPhone

Tres Finocchiaro

unread,
Aug 29, 2012, 9:08:39 AM8/29/12
to jzebra...@googlegroups.com
Is there any Mac experts that can help?    


Leandro,

How is your printer connected? 

-Tres

Leandro Gregolin

unread,
Aug 29, 2012, 9:13:17 AM8/29/12
to jzebra...@googlegroups.com
It is connected by USB.

Sent from my iPhone

Tres Finocchiaro

unread,
Aug 29, 2012, 7:42:47 PM8/29/12
to jzebra...@googlegroups.com
Interesting, previously reported was USB too.

Are the CUPS dialogs different in mountain lion?

Was the documentation link from zebra helpful at all?

Lastly, do you have access to a Leopard or Snow Leopard Mac to try it on?

-Tres

Leandro Gregolin

unread,
Aug 29, 2012, 11:36:42 PM8/29/12
to jzebra...@googlegroups.com
Hi Tres.
I never had needed to use CUPS in Lion, so I don't know if it is different.
The Zebra Documentation is ok... I could install the printer by zebra documentation way or jzebra way... both work fine by line command (sent by terminal).
Unfortunately I don't have another Mac to test it :-(

Leandro Gregolin

Tres Finocchiaro

unread,
Aug 30, 2012, 1:01:40 AM8/30/12
to jzebra...@googlegroups.com
Since it works by command line, I have a feeling this is a bug with Java on Mountain Lion.

If you can dig anything else up on this, let me know.  This could completely kill jzebra's raw printing feature on new Macs if that's the case... 

Alternatively, I could use Java to issue a shell command that does the printing from a terminal window behind the scenes, but this is a very poor way to do it.

-Tres

Leandro Gregolin

unread,
Aug 30, 2012, 1:19:04 AM8/30/12
to jzebra...@googlegroups.com
It's really strange :-)
Some minutes ago I opened a PDF file in a browser and I sent it to TLP 2844 (like a normal printer, printing by browser), and the TLP has printed the PDF (with images) normally... of course, some problems like a small image and rotated, but I could see it normally.
This seems me it's a really Java problem, because I could print by browser (very unusual for this printer) and I couldn't print by jzebra.
And I confirm... I did many tests and the printer works fine by line command with the command:

lpr -P [printer] -o raw [file.txt]

Where:
[printer]: Printer's name in my cmputer
[file.txt]: EPL file commands

Thanks.


Leandro Gregolin

Tres Finocchiaro

unread,
Aug 30, 2012, 1:38:19 AM8/30/12
to jzebra...@googlegroups.com
Two ideas....

1. There's a fairly new feature that allows you to write to file.  Can you try writing directly to the printer device as if it's a file?

2.  Is there a chance there are two printers detected by java with similar names?  Clicking "list all printers" should verify this.


-Tres

Leandro Gregolin

unread,
Aug 30, 2012, 8:57:10 AM8/30/12
to jzebra...@googlegroups.com
1 - How do I do that? Can you send me a example?
2 - There is only one Zebra printer... I had already done this test before.

Thanks.

Leandro Gregolin

Tres Finocchiaro

unread,
Aug 30, 2012, 10:22:27 AM8/30/12
to jzebra...@googlegroups.com
If you have permission to write directly to the unix device, the syntax would be like this:

I can't imagine this would work, but this is the general syntax I was thinking... 
document.jzebra.printToFile("usb://Zebra%20Technologies/ZTC%20LP2824-Z-200dpi?serial=24A084700010");
or
document.jzebra.printToFile("/dev/usb/lp0");
-Tres

Tres Finocchiaro

unread,
Aug 30, 2012, 11:17:11 AM8/30/12
to jzebra...@googlegroups.com
What if you set the printer up normally via this link:


-Tres

Leandro Gregolin

unread,
Aug 30, 2012, 11:35:17 AM8/30/12
to jzebra...@googlegroups.com
I've configured the printer this way too, and it works fine by line command, but not with jzebra.
The printer driver (or configuration) isn't the problem... by system preferences, by cups admin or by cups line command (http://rofish.net/2010/12/printing-raw-epl-on-the-lp2844-from-a-mac-or-linux/) all of them works fine sending commands by lpr -P [printer] -o raw [file.txt]

Leandro Gregolin

Leandro Gregolin

unread,
Aug 30, 2012, 11:35:53 AM8/30/12
to jzebra...@googlegroups.com
I will test these ways at night and I post the result.
Thanks.

Leandro Gregolin

Leandro Gregolin

unread,
Aug 31, 2012, 12:44:34 AM8/31/12
to jzebra...@googlegroups.com
It doesn't work too :-(
A question... where do I define what printer I want to send the content?
Thanks.

Leandro Gregolin

Tres Finocchiaro

unread,
Aug 31, 2012, 10:42:29 AM8/31/12
to jzebra...@googlegroups.com
document.jzebra.findPrinter("printer_name");

Leandro Gregolin

unread,
Sep 3, 2012, 3:26:32 PM9/3/12
to jzebra...@googlegroups.com
Unfortunately it doesn't work in OSX Mountain Lion :-(
I tried different configurations but anything has success.
In my first test on Ubuntu, it worked fine.
If someone have any idea would be great.
Thanks.

Leandro Gregolin

Tres Finocchiaro

unread,
Sep 3, 2012, 3:32:37 PM9/3/12
to jzebra...@googlegroups.com
This would suggest it is an Oracle or Apple bug.

I've searched quite a bit to no avail.  Does anyone have a corporate Oracle supported account they can raise this issue with?

Is Java in Mt Lion apple or Oracle provided?  Are there any alternate options?

This is pretty important since it kills jZebra for future macs.

-Tres

Ben Juteau

unread,
Sep 18, 2012, 9:20:48 PM9/18/12
to jzebra...@googlegroups.com
I just stumbled on a solution. 
1. First, upgraded my java to version 7, care of java.com
2. Next, add the zebra printer to CUPS manually using the web interface as a raw printer as per http://code.google.com/p/jzebra/wiki/TutorialRawOSX#Introduction

Now, web apps that use jzebra to print (such as UPS) automatically locate the printer and print accordingly

Tres Finocchiaro

unread,
Sep 18, 2012, 10:05:02 PM9/18/12
to jzebra...@googlegroups.com
Ben,

What version of OSX are you running?

-Tres

Ben Juteau

unread,
Sep 18, 2012, 10:05:57 PM9/18/12
to jzebra...@googlegroups.com
Mountain Lion, 10.8

Ben
Reply all
Reply to author
Forward
0 new messages