a guest Jun 20th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [HttpGet]
  2.         public async Task<IActionResult> GetPDF(/*some arguments*/)
  3.         {
  4.             /*
  5.             Here I get images (as byte arrays) and captions from the
  6.             database
  8.             Then I want to create a pdf and loop over the images and
  9.             alternate adding a caption and an image to the pdf
  10.             */
  11.             using (var streamPdf = new MemoryStream())
  12.             {
  13.                 //Next line saves pdf to memorystream so it can be sent
  14.                 document.Save(streamPdf);
  15.                 return File(streamPdf.ToArray(), "application/pdf");
  16.             }
  18.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand