Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  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
  7.  
  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. }
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement