ramonlopes / jzebra

Automatically exported from code.google.com/p/jzebra
0 stars 0 forks source link

Using Generic text-only printer on Linux #17

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is not an issue, but an enhancement.

Can I use a Generic text-only printer driver on Linux boxes instead of the "raw 
queue", so other applications can still use the same printer, even if not raw?

For instance, with "lp" I can force a raw print to any "generic" printer with 
"-o raw". Is it possible with jZebra, considering the same works correctly on 
Windows with the "Generic / text-only" driver?

Thanks in advance.

Original issue reported on code.google.com by renat...@gmail.com on 9 Oct 2010 at 7:34

GoogleCodeExporter commented 8 years ago
@renatoat:

It is hard to know how the OS will treat your raw commands if sent to a non 
"RAW" queue.

My best answer is that the "-o raw" command line parameter actually forces the 
installed printer to ignore its settings on an OS level and use it as a raw 
device instead.

This behavior is possible because Linux offers a way to bypass the desired 
behavior of that device and treat it as a raw device.

jZebra could certainly provide that functionality, but it would have to use a 
platform-dependent OS call.  Since a Java Applet is perfectly capable of doing 
this (after accepting the security dialog), a parameter, such as 
"applet.useShellCommand(true)" could be added.

The unfortunate design flaws to this approach is:
1.  All printed content must first spool to the file system.
2.  Printer name must match exactly
3.  LP command parameters may vary depending on UNIX system
4.  Won't work well or at all in Windows (I only know of LPT1 allowing input 
redirection from RAW files)

If implemented, the flow would be as follows:

1.  Applet loads in browser
2.  Parameter "useShellCommand" set
3.  Print command sent to applet
4.  Applet writes contents to local workstation, ex:  /tmp/jzebra-19293.raw
5.  Applet executes command "lp -d Zebra -o raw < /tmp/jzebra-19293.raw"
6.  Applet waits for executed command to finish

So I'll ask the requestor to provide a working "lp -o raw" command for your 
system, and I'll happily add experimental support in jZebra.

Please contact me tres.finocchiaro@gmail.com if interested!

-Tres

Original comment by tres.fin...@gmail.com on 20 Nov 2010 at 2:11

GoogleCodeExporter commented 8 years ago
I aprecciate the answer, but I don't think it is worth the time to develop a 
OS-dependent solution as we can configure a RAW printer when needed, no problem 
with that.

I submitted the ticket thinking it would be possible with a pure-Java solution.

You can close this ticket as Invalid or something like that. This enhancement 
is not needed at all, would just be easier for my users.

Thanks for the help.

Original comment by renat...@gmail.com on 22 Dec 2010 at 10:29

GoogleCodeExporter commented 8 years ago
Thanks.  Consider this open to suggestions/feedback.  Marking as Invalid per 
OP's request.

Original comment by tres.fin...@gmail.com on 23 Dec 2010 at 2:00