I'm sending RAW data (escape codes) to the printer with the following code:
PrintService pservice = this.getPrintService();
DocPrintJob job = pservice.createPrintJob();
DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;
Doc doc = new SimpleDoc(printdata, flavor, null);
job.addPrintJobListener(this);
try {
job.print(doc, null);
...
This works correctly in Windows, the printer interprets the escape codes and prints as i would expect.
In Linux (i installed the CUPS version of the driver) when i send the raw data it simply prints an empty page and reports a printing error. The weird thing is that if i send the data using the system lpr command everything works correctly.
Any clues on what could be going wrong?
[note]Feel free to edit my title, i couldn't think of a better one
[edit] This is the error log I get: LOGS
[edit2]Similar thread with a solution i do not really like: Linux printing in java
[edit3] Experimenting with different DocFlavors i came up with new errors:
E [07/Dec/2012:17:45:44 +0100] Unknown directive SystemGroup on line 4 of /etc/cups/cupsd.conf.
E [07/Dec/2012:17:45:44 +0100] Unknown directive JobPrivateAccess on line 85 of /etc/cups/cupsd.conf.
E [07/Dec/2012:17:45:44 +0100] Unknown directive JobPrivateValues on line 86 of /etc/cups/cupsd.conf.
E [07/Dec/2012:17:45:44 +0100] Unknown directive SubscriptionPrivateAccess on line 87 of /etc/cups/cupsd.conf.
E [07/Dec/2012:17:45:44 +0100] Unknown directive SubscriptionPrivateValues on line 88 of /etc/cups/cupsd.conf.
W [07/Dec/2012:17:45:44 +0100] CreateProfile failed: org.freedesktop.ColorManager.AlreadyExists:profile id 'LabelWriter-400-Gray..' already exists
W [07/Dec/2012:17:45:44 +0100] CreateDevice failed: org.freedesktop.ColorManager.AlreadyExists:device id 'cups-LabelWriter-400' already exists
Could this point to a CUPS configuration error?