Exemple #1
0
        public IActionResult GeneratePdf(int tripId, string generatepdf)
        {
            var vm = tripDetailsRepository.GetById(tripId);

            MemoryStream stream = pdfCreator.CreatePdf(vm, generatepdf);

            //Defining the ContentType for pdf file.
            string contentType = "application/pdf";

            //Creates a FileContentResult object by using the file contents, content type, and file name.
            return(File(stream, contentType));
        }
 private void CreatePdf(List <TicketViewModel> ticketInfo)
 {
     pdfCreator.CreatePdf(ticketInfo);
 }