Cannot access a closed stream in pdf generation
See the question and my original answer on StackOverflowPdfWriter closes the stream by default. Just add the following line after PdfWriter.GetInstance
writer.CloseStream = false;
PdfWriter closes the stream by default. Just add the following line after PdfWriter.GetInstance
writer.CloseStream = false;