How to add image or logo in the fax output?
Here are some code's that i used but not displaying the image. Only the text output displayed.
public static JobSubmitRequestDocument createELJobSubmitRequestDocument(StringBuffer formattedFaxMessage, String faxNumber, String accountName ) {
JobSubmitRequestDocument jobSubmitRequestDocument = JobSubmitRequestDocument.Factory.newInstance();
JobSubmitRequest jobSubmitRequest = jobSubmitRequestDocument.addNewJobSubmitRequest();
MessageType message = jobSubmitRequest.addNewMessage();
JobOptionsType jobOption = message.addNewJobOptions();
FaxOptionsType faxOption = jobOption.addNewFaxOptions();
EncodableStringType billingCode = jobOption.addNewBillingCode();
//billingCode.setStringValue(billingNum.toString());
EncodableStringType customerReference = jobOption.addNewCustomerReference();
accountName = accountName.contains(",") ? accountName.replace(",", ";") : accountName;
customerReference.setStringValue(accountName);
DeliveryItemListType destinations = message.addNewDestinations();
FaxType fax = destinations.addNewFax();
fax.setPhone(faxNumber);
ContentsType content = message.addNewContents();
ContentPartType part = content.addNewPart();
DocumentType document = part.addNewDocument();
document.setDocType("HTML");
DocDataType docData = document.addNewDocData();
docData.setFormat(DocEncodingFormat.TEXT);
docData.setStringValue(formattedFaxMessage.toString());
return jobSubmitRequestDocument;
}
StringBuffer htmlBuffer = new StringBuffer();
htmlBuffer.append("<html><head>");
htmlBuffer.append("<style> .eLabel { color: black; font-family: Arial, Verdana; font-size: 12px; font-style: bold; font-weight: bold; text-align: left; } </style>");
htmlBuffer.append("</head><body><table>");
htmlBuffer.append("<tr><td><table width=100% bgcolor=#ceefbd cellpadding=0>");
htmlBuffer.append("<td><netui:img src=\"<%=request.getContextPath()%>/TEST_Portal/WebContent/resources/images/TESTLogo.gif\"></td>");
//htmlBuffer.append("<tr><td colspan=2><b>test</b></td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td>Name of Financial Institution:</td><td>" + XTFGridRow[j].getMFXFINANCIALNM() + "</td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td>Fax Number:</td><td>" + faxNo + "</td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td>Date:</td><td>" + createDate + "</td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td>To whom it may concern:</td><td>" + "</td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td>This is your authorization to release $:</td><td>" + XTFGridRow[j].getMFXAMTRELEASE() + "</td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td>Placed on hold (date)</td><td>" + XTFGridRow[j].getMFXHOLDDATE() + "</td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td>Account # </td><td>" + accountNo + "</td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td>Approval code # </td><td>" + XTFGridRow[j].getMFXAPPROVALCD() + "</td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td>Client:</td><td>" + XTFGridRow[j].getMFXCLIENT() + "</td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td>Thank you in advance for your prompt attention to this matter. </td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td>Sincerely, </td><td>" + "</td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td> "+agent.getUserName()+" </td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td> test</td><td>" + "</td></tr>");
htmlBuffer.append("<tr><td> </td></tr>");
htmlBuffer.append("<tr><td> Customer Service Representative </td><td>" + "</td></tr>");
htmlBuffer.append("</table></td></tr>");
htmlBuffer.append("</table></td></tr>");
htmlBuffer.append("</table></body></html>");
logCtrl.logDebug(htmlBuffer.toString());
/*" " +
" test \n\n " +
" Name of Financial Institution: "+XTFGridRow[j].getMFXFINANCIALNM()+" \n\n " +
" Fax Number: "+faxNo+" \n\n " +
" Date: "+createDate+" \n\n " +
" To whom it may concern: \n\n " +
" This is your authorization to release $ "+XTFGridRow[j].getMFXAMTRELEASE()+" \n\n " +
" Placed on hold (date) "+XTFGridRow[j].getMFXHOLDDATE()+" \n\n " +
" Account # "+accountNo+" \n\n " +
" Client: "+XTFGridRow[j].getMFXHOLDDATE()+" \n\n " +
" Thank you in advance for your prompt attention to this matter. \n\n " +
" Sincerely, \n\n\n\n " +
" "+agent.getUserName()+" \n\n " +
" test \n\n " +
" Customer Service Representative \n\n " +
" "*/
JobSubmitRequestDocument requestDocument = EasyLinkUtil.createELJobSubmitRequestDocument(htmlBuffer, faxNo, "test" );
jobSubmitServiceControl.jobSubmit(requestDocument, EasyLinkUtil.createELRequestDocument(user, password), jobSubmitResultDocumentHolder, responseDocumentHolder);
final String[] easyLinkResults = EasyLinkUtil.parseELJobSubmitResultDocument(jobSubmitResultDocumentHolder);
if (FAIL.equalsIgnoreCase(easyLinkResults[0])) {
logCtrl.logDebug(" "+accountNo+" Fax Sending Mail: " + "is FAILED " );
} else {
logCtrl.logDebug(" "+accountNo+" Fax Sending Mail: " + "is SUCCESS " );
}