I need to print the report from a Java desktop application to a dot-matrix printer (Epson LX-300 II). Report consists of text ang some graphics. Printer is connected via USB and I'm using CUPS to print. I'm printing using the Printable interface (pretty standard in Java).
My problem:
Text printing quality is very low on every printer resolution (60x60, 120x60, 120x72). It seems like there's no font hinting at all in some printer driver. Letters is looking very ugly. I can't use direct text-out to port (it looks great), 'cause I need also to print graphics on the same page.
It seems that problem is not in Java, cause the same application prints the high-quality text and graphics in Windows. Also it seems that problem is not in CUPS system, cause OpenOffice or Abiword prints the same text with the same fonts with the very good quality (worse than in Windows but still good).
Also problem is not with fonts: i'm tryed the Tahoma font from Windows, and it does the same: low quality while printing in java/linux.
The problem is not with BCI-hinting in X.Org, displaying on the screen is great looking.
When I export any document from OpenOffice to PDF and printing that PDF, I got the same effect - ugly not-hinted fonts on the paper. If the same document is printed from Office, everything is ok.
I tryed different Linuxes (KUbuntu 10.04, Puppy 2, Puppy 4.3.1) and I got the same effect on any Linux.
Maybe the problem is in Ghostscript, I got 9.x version on Puppy and still the same. Or also I think that there can be problem with CUPS rasterizer ('rastertoepson' or 'foomatic-rip').
It's example of output (sorry for the "mobile"-quality photo):
I just got no idea what's going on, help me please.
-- P.S. my final solution is to use 'ESCPrinter.java" open-source class, adding to it a capability of printing images according Epson documentation.
You could give
setRenderingHint
a try; copied some calls together for typing ease. Maybe it is TEXT_ANTIALIASING, but I would not exclude the others.An other idea, would be that somewhere screen resolution is scaled to print resolution; a small java app with do-it-yourself printing would show that.
You did not do a
rotate
, did you? (Just seeing the photo).