Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.8.1
-
None
-
Windows 7 64-bit, jdk 1.6.0_20
-
Novice
Description
In org.apache.camel.component.printer.PrinterProducer, the line:
setPrinter("\\\\" + config.getHostname() + "
" + config.getPrintername());
reconstructs a UNC path which is expected to match the name of a PrintService on the system. For local printers on Windows, the name of the PrintService is simply the name of the printer without the host and any backslashes, so the PrinterProducer is never able to find them.
So when config.getHostname() is "localhost", at least on Windows, the line should be simply:
setPrinter(config.getPrintername())
so that we'd have code like:
if ("localhost".equalsIgnoreCase(config.getHostname())) {
setPrinter(config.getPrintername());
} else {
setPrinter("\\\\" + config.getHostname() + "
" + config.getPrintername());
}
This can only work if issue CAMEL-4477 about the error in parseURI() in PrinterConfiguration is also fixed.