I have Thermal Receipt Printer model RP58E
from Xiamen Rongta Technology. I know this one doesn't have drivers for Linux, but I managed to set it up manually. What I did: Printers -> Add Printer -> Selected Unknown
-> Forward -> under select printer from database I chose Generic (recommended)
-> Forward -> here I chose text-only (recommended)
and then finished. But this way I can only print Text and not images and I'd like to print images as well. Is there anyway I can achieve this?
I'm making a Java program for the printing, I wrote it like this:
public void printImage(String printerName, String imgLocation) throws PrintException, IOException {
DocFlavor flavor = DocFlavor.INPUT_STREAM.PNG;
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
aset.add(new PrinterResolution(205, 205, PrinterResolution.DPI));
aset.add(new MediaPrintableArea(0, 0, 48, 48, MediaPrintableArea.MM));
PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
for(PrintService printService : services) {
if(printService.getName().equals(printerName)) {
DocPrintJob pj = printService.createPrintJob();
FileInputStream fis = new FileInputStream(imgLocation);
Doc doc = new SimpleDoc(fis, flavor, null);
pj.print(doc, aset);
}
}
}
Can I somehow print images if I have text-only (recommended)
set-up for printer?
EDDIT: Here are screenshots of options to choose from when setting up printer:
I found a fix to this drivers problem by installing https://github.com/klirichek/zj-58 this driver.
I found out, that most thermal printers have the same commands for printing, so it has little to no change. The only problem I've noticed so far is that the text printed is a bit larger than with original drivers.