Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [HttpGet]
- public async Task<IActionResult> GetPDF(/*some arguments*/)
- {
- /*
- Here I get images (as byte arrays) and captions from the
- database
- Then I want to create a pdf and loop over the images and
- alternate adding a caption and an image to the pdf
- */
- using (var streamPdf = new MemoryStream())
- {
- //Next line saves pdf to memorystream so it can be sent
- document.Save(streamPdf);
- return File(streamPdf.ToArray(), "application/pdf");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement