Question Creating a PDF document with iText

Manie Verster

Member
Joined
Nov 22, 2023
Messages
22
Programming Experience
10+
Create PDF Document from database data.:
string pdfReport = "";
DateTime now = DateTime.Now;
if (RecipeID == "0")
{
    pdfReport += "Recipe_All_" + now.ToString("yyyyMMddHHmmss") + ".pdf";
}
else
{
    pdfReport += "Recipe_" + RecipeName + "_" + now.ToString("yyyyMMddHHmmss") + ".pdf";
}
string pdfFilePath = "C:\\Projects\\RecipeManager\\PDF Reports\\" + pdfReport;
PdfWriter writer = new PdfWriter(pdfFilePath);

Hi guys,

I need some help, please. I am trying to create a PDF document from database data to serve as a report. I, however, did not get to the data part yet because I am getting an unknown error on the code shown in bold above. I am using iText to create this document. Please can someone help me? The error is shown below.

Stack trace:
1700647256287.png

Inner exception:
1700647443872.png


I tried to show as much information here as possible but if you need more just ask. I am completely new to this so please ignore the stupity.
 
Last edited by a moderator:
Solution
Install Nuget package itext7.bouncy-castle-adapter
Install Nuget package itext7.bouncy-castle-adapter
 
Solution

Latest posts

Back
Top Bottom