using (var stream = new MemoryStream())<o:p></o:p>
// Start by opening first pdf
using (var pdfDoc = new Document(pdfFiles))
var nextPdf = new Document();
// Starting with second, concat all the rest
for (int i = 1; i < pdfFiles.Count; i++)
nextPdf = new Document(pdfFiles[i]);
pdfDoc.Save(stream); // Error: Cannot access a closed Stream.
return new FileContentResult(stream.ToArray(), "application/pdf");
We are sorry for the inconvenience caused.
Thanks, but doesn’t this cause the problem I was trying to prevent (by utilizing the using construct)?