public async Task <string> RenderToHtmlAsStringAsync(CertificateViewModel viewModel) { if (viewModel == null) { throw new ArgumentNullException(nameof(viewModel)); } return(await _viewRenderService.RenderViewToStringAsync(ViewName, viewModel)); }
public async Task <Stream> RenderToPdfAsStreamAsync(CertificateViewModel viewModel) { if (viewModel == null) { throw new ArgumentNullException(nameof(viewModel)); } var html = await RenderToHtmlAsStringAsync(viewModel); return(await _pdfRenderService.RenderHtmlAsync(html, new PdfRenderOptions { Format = "A4", Scale = 0.8f })); }