how to attach a scanned doc (image) to my invoice?

Aug 16, 2013 at 5:33 PM
hello all, first of all it is a great job, secondly I want to attach supporting document, which stored as image, to my invoice, any suggestion doing it in the context of this project?
Aug 17, 2013 at 6:54 PM
Edited Aug 17, 2013 at 6:59 PM
Hi zzmarmoh,

the <image> tag only can take a path of image file


<image src="{var}">
<var name="{var}">

I don't think this is what u want. The image tag cannot take a binary image stream.

Another way is to use iTextSharp.text.pdf.PdfStamper to manipulate the content generate by pdfTemplate.

after u finish process ur data..
System.IO.MemoryStream mStream = pdfTmpl.Close();
iTextSharp.text.pdf.PdfReader reader = new iTextSharp.text.pdf.PdfReader(stream.ToArray());
iTextSharp.text.pdf.PdfStamper stamper = new iTextSharp.text.pdf.PdfStamper(reader, stream);

use the stamper to insert ur image.
Aug 21, 2013 at 8:41 PM
this will help, thanks for your quick reply, it is a pleasure getting such a help from a man of your pedigree :)