iText.Kernel.Exceptions.PdfException: 'Unknown PdfException.'

ykl
ykl
330 Points
17 Posts

I'm using itext to generate pdf as follows:

public void RenderPage(string filePath)
{
    using (var writer = new PdfWriter(filePath))
    {
        using (var pdf = new PdfDocument(writer))
        {
            var document = new Document(pdf);

            foreach (var componentRenderer in _reportComponentRenderer)
            {
                componentRenderer.Value.Render(document);
            }
        }
    }
}
<PackageReference Include="itext" Version="9.0.0" />

Getting following errors:

iText.Kernel.Exceptions.PdfException: 'Unknown PdfException.'
NotSupportedException: Either com.itextpdf:bouncy-castle-adapter or com.itextpdf:bouncy-castle-fips-adapter dependency must be added in order to use BouncyCastleFactoryCreator

Views: 38
Total Answered: 1
Total Marked As Answer: 0
Posted On: 06-Jan-2025 04:35

Share:   fb twitter linkedin
Answers
ykl
ykl
330 Points
17 Posts
         

I tried with follwong packages but still getting same error:

itext.bouncy-castle-adapter.9.0.0
itext.bouncy-castle-fips-adapter.9.0.0
Portable.BouncyCastle.1.9.0




Posted On: 06-Jan-2025 04:51
 Log In to Chat