private readonly string _title; private readonly List<string> _items; public CustomPdf(string title, List<string> items) => (_title, _items) = (title, items);
columns.RelativeColumn(); columns.RelativeColumn(2); ); table.Cell().Text("Item"); table.Cell().Text("Description"); ); page.Footer().AlignCenter().Text("Generated by ASP.NET Core 5.0"); ); customizing asp.net core 5.0 pdf
Format = PaperFormat.A4, MarginOptions = new MarginOptions Top = "20mm", Bottom = "20mm" , PrintBackground = true, HeaderTemplate = "<span style='font-size:10px'>Custom Header</span>", FooterTemplate = "<span style='font-size:8px'>Page <span class='pageNumber'></span></span>" ); private readonly string _title
container.Page(page => page.Size(PageSizes.A4); page.Margin(1, Unit.Cm); page.Header().Text(_title).Bold().FontSize(18); page.Content().Column(col => foreach (var item in _items) col.Item().Text(item); ); page.Footer().AlignCenter().PageNumber(); ); private readonly List<
| Approach | Memory per request | Concurrency | Notes | |----------|------------------|-------------|-------| | PuppeteerSharp | ~100-200 MB | Poor (reuse browser instance) | Use singleton browser, parallel pages | | IronPDF | ~80-150 MB | Moderate | Pool browser processes | | QuestPDF | ~5-20 MB | Excellent | No external processes | | PdfSharpCore | ~5-15 MB | Excellent | Pure .NET |
page.Size(PageSizes.A4); page.Margin(2, Unit.Centimetre); page.Header().Text("Custom Invoice").SemiBold().FontSize(20); page.Content().Table(table =>