コード例 #1
0
        /// <summary>
        /// GET /home/streaming
        /// </summary>
        public IActionResult Streaming()
        {
            var outputStream = new MemoryStream();

            InMemoryPdfReport.CreateStreamingPdfReport(_hostingEnvironment.WebRootPath, outputStream);
            return(new FileStreamResult(outputStream, "application/pdf")
            {
                FileDownloadName = "report.pdf"
            });
        }
コード例 #2
0
 /// <summary>
 /// GET /home/streaming
 /// </summary>
 public async Task <IActionResult> Streaming()
 {
     return(await RunThrottledAsync(() =>
     {
         var outputStream = new MemoryStream();
         InMemoryPdfReport.CreateStreamingPdfReport(_hostingEnvironment.WebRootPath, outputStream);
         return new FileStreamResult(outputStream, "application/pdf")
         {
             FileDownloadName = "report.pdf"
         };
     }));
 }