protected void Page_Load(object sender, EventArgs e) { var AspxToPdfOptions = new IronPdf.PdfPrintOptions() { DPI = 300, }; if (!Page.IsPostBack) { SetInitialRow(); } }
private static IronPdf.PdfDocument RenderPdf(string Html, IronPdf.PdfPrintOptions PrintOptions = null) { var Renderer = new IronPdf.HtmlToPdf(); Renderer.PrintOptions.CssMediaType = PdfPrintOptions.PdfCssMediaType.Print; if (PrintOptions != null) { Renderer.PrintOptions = PrintOptions; } PdfDocument Pdf = Renderer.RenderHtmlAsPdf(Html); return(Pdf); }
private static async Task <IronPdf.PdfDocument> RenderPdfAsync(string Html, IronPdf.PdfPrintOptions PrintOptions = null) { return(await Task.Run(() => RenderPdf(Html, PrintOptions))); }