i have various pdf files say file1.pdf, file2.pdf.......... Now I want to create a new pdf document say MainDoc.pdf. And this MainDoc.pdf will contain File1.pdf,File2.pdf... as attachments.
Tried this code but it is giving error :
"Object Refrence not set to an instance
"
its.Document PDFD = new its.Document(its.PageSize.LETTER);
its.pdf.PdfWriter writer;
writer = its.pdf.PdfWriter.GetInstance(PDFD, new FileStream(targetpath, FileMode.Create));
its.pdf.PdfFileSpecification pfs = its.pdf.PdfFileSpecification.FileEmbedded(writer, "C:\\test.xml", "New.xml", null);
writer.AddFileAttachment(pfs);
It Looks like issue is with writer.
Object reference not set to an instance of an object. at iTextSharp.text.pdf.PdfWriter.get_PdfIndirectReference()