Created
June 18, 2019 15:43
-
-
Save jtheisen/5b617a1cac3d72d908730163372546e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rows = String.Join("", Enumerable.Range(1, 100).Select(i => $"<tr><td>row #{i}</td></tr>").ToArray()); | |
var html = $@" | |
<div> | |
<table> | |
<thead> | |
<tr> | |
<td>header</td> | |
</tr> | |
</thead> | |
<tbody> | |
<tr> | |
<td> | |
<table> | |
<thead> | |
<tr> | |
<td>header2</td> | |
</tr> | |
</thead> | |
<tbody> | |
{rows} | |
</tbody> | |
</table> | |
</td> | |
</tr> | |
</tbody> | |
</table> | |
</div> | |
"; | |
var Renderer = new IronPdf.HtmlToPdf(); | |
var pdf = Renderer.RenderHtmlAsPdf(html); | |
var OutputPath = @"c:\users\jens\downloads\test.pdf"; | |
pdf.SaveAs(OutputPath); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment