private byte[] flushFileInBrowser()
{
if (!FlushInBrowser && !OutputAsByteArray)
{
return null;
}
// close the document without closing the underlying stream
PdfWriter.CloseStream = false;
PdfDoc.Close();
_pdfRptData.PdfStreamOutput.Position = 0;
// write pdf bytes to output stream
var pdf = ((MemoryStream)_pdfRptData.PdfStreamOutput).ToArray();
if (FlushInBrowser)
{
SoftHttpContext.FlushInBrowser(_pdfRptData.FileName, pdf, FlushType);
}
return pdf;
}