Esempio n. 1
0
        public async Task <IActionResult> ExportPdf()
        {
            try
            {
                ValidateSecretKey();

                var html = await ReadContentBodyAsync();

                var pdfPath = _pdfGenerator.ConvertHtmlToPdfFromHtml(html);
                if (!string.IsNullOrEmpty(pdfPath))
                {
                    return(Success(GetHostUrl() + pdfPath));
                }

                return(Failure());
            }
            catch (Exception ex)
            {
                return(Failure(ex));
            }
        }