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

Aug 16, 2013 at 4: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?
Coordinator
Aug 17, 2013 at 5:54 PM
Edited Aug 17, 2013 at 5:59 PM
Hi zzmarmoh,

the <image> tag only can take a path of image file
src="/path/of/image.jpg"

or

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

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.
https://github.com/itextsharper/iTextSharp-4.1.6/blob/master/iTextSharp/text/pdf/PdfStamper.cs

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 7:41 PM
this will help, thanks for your quick reply, it is a pleasure getting such a help from a man of your pedigree :)