Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Generate single pdf using a list of objects in QuestPDF

$
0
0

I'm trying to generate a PDF using QuestPdf in my C# application. I have a list of objects and I need to apply the Quest template to each row in the list inside of a single document.

For example, if I do this:

byte[] pdf;foreach ( var app in applications ){    pdf = document.GeneratePdf();    ...}

I (obviously) get a bunch of documents. Since there are hundreds of rows in my list, this is very difficult to work with.

I thought I could put the foreach inside the Quest Compose method, but I don't know how I can reference the object's properties and the resulting document seems to still only give me one copy of the template.

foreach ( var obj in objects ){    page.Header().Element( ComposeHeader );    page.Content().Element( ComposeContent );    page.Footer().Element( ComposeFooter );}

How can I use QuestPDF to iterate the list and have a multiple page pdf with a page for each item in the list?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>