Doc myDoc = new SimpleDoc(bais, psInFormat, null);
PrintServiceAttributeSet psaset = new HashPrintServiceAttributeSet();
if (UtilValidate.isNotEmpty(printerName)) {
try {
URI printerUri = new URI(printerName);
PrinterURI printerUriObj = new PrinterURI(printerUri);
psaset.add(printerUriObj);
} catch (URISyntaxException ue) {
Debug.logWarning(ue, "Invalid URI for printer [" + printerName + "]", module);
}
}