Dynamic PDF Email Attachments
I have a PDF file stored in the BLOB field of Oracle DB.
Is there a way to dynamically attach this PDF file in a mail without storing it into server machine?
My other requirement is to show the same file to the user. By using itext i am able to do the same. After reading the Byte Array i am using the PDFWriter to do the same.
Document document = new Document();
ByteArrayOutputStream baosPDF = (ByteArrayOutputStream) this.testStreamBLOB();// this will return me the Byte Array from DB
PdfWriter docWriter = PdfWriter.getInstance(document, baosPDF);
ServletOutputStream sos = response.getOutputStream();
Is ther a way to use the same logic for sending it as an attachment?