public byte[] GeneratePdfFromTemplate(string content, string name) { try { TemplateContentDomain templateContentDomain = JObject.Parse(content).ToObject <TemplateContentDomain>(); if (templateContentDomain.Type == Common.Enumerations.TemplateType.Text) { return(_pdfGenerator.GenerateTextTemplatePdf(templateContentDomain.Payload, name)); } else { return(_pdfGenerator.GenerateTableTemplatePdf(templateContentDomain.Payload, name)); } } catch (Exception e) { throw new NsiBaseException(DocumentMessages.PDFGeneratorFailed, e, Common.Enumerations.SeverityEnum.Error); } }