Esempio n. 1
0
        public ActionResult Pdf(int id, string niceUrl, string searchTerms)
        {
            var catalogue = _unitOfWork.Catalogues.FindBy(id);

            if (catalogue == null)
            {
                throw new HttpException(404, "Not found");
            }

            MemoryStream stream = new MemoryStream();

            _catalogueService.CreatePdf(id, searchTerms, stream);

            stream.Flush();
            stream.Position = 0;

            return(File(stream, "application/pdf"));
        }