I succeeded in creating a single pdf, but how can I design a loop for file names? The Problem is every Loop my file will be overwritten
I tried to add a variable to the
Thanks, you helped me a lot! This is the Code that works for me:
var pdf1 =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
strGPNrVar + "_" + DateTime.Now.ToString("yyyy-MM-dd-hh.mm.ss")
+ $"_Report.pdf");
using (FileStream fs = new FileStream(pdf1, FileMode.Create,
FileAccess.Write, FileShare.None))
{
Document document = new Document(PageSize.A4);
PdfWriter writer = PdfWriter.GetInstance(document, fs);