public static byte[] ConvertToPdf(this HtmlTag tag) { // todo this method is ok, but how about we also move this code somewhere and make a builder that can be controlled instead of defaults here and then keep this method but plugin to the builder. var html = tag.ToString(); var settings = new ExportEventArgs.ExportSettings { PdfPageOrientation = PDFPageOrientation.Portrait, PdfPageSize = PdfPageSize.Letter }; var options = new ExportEventArgs(html, "export") { ExportType = ExportType.CustomPdf, SendByEmail = false, Settings = settings }; return ExportPdfHelper.ToPdfBytes(options); }
public static byte[] ConvertToPdf(this HtmlTag tag) { // todo this method is ok, but how about we also move this code somewhere and make a builder that can be controlled instead of defaults here and then keep this method but plugin to the builder. var html = tag.ToString(); var settings = new ExportEventArgs.ExportSettings { PdfPageOrientation = PDFPageOrientation.Portrait, PdfPageSize = PdfPageSize.Letter }; var options = new ExportEventArgs(html, "export") { ExportType = ExportType.CustomPdf, SendByEmail = false, Settings = settings }; return(ExportPdfHelper.ToPdfBytes(options)); }