I am new to iTextSharp (C # iText version):
I have something like this:
System.Drawing.Bitmap bitmap = (System.Drawing.Bitmap)ChartHelper.GetPdfChart((int)currentVuln.UrgencyRating * 10); iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(bitmap); vulnerabilityDetailsTable.AddCell(new PdfPCell(img) { Border = PdfPCell.RIGHT_BORDER, BorderColor = new BaseColor(79, 129, 189), BorderWidth = 1, Padding = 5, MinimumHeight = 30, PaddingTop = 10 });
As you can see, I have a classic System.Drawing.Bitmap called bitmap , and I want to put it in the cell of the PDF document table.
The problem is that this line is signed as an error:
iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(bitmap);
Error:
Error 75 The best overloaded method matching for 'iTextSharp.text.Image.GetInstance (iTextSharp.text.Image)' has some invalid arguments c: \ Develop \ EarlyWarning \ public \ Implementazione \ Ver2 \ PdfReport \ PdfVulnerability.cs 120 27 PdfReport
Therefore, I think I need to get the iTextSharp.text.Image object from the classic System.Drawing.Bitmap object.
What can I do for this? I'm losing my mind trying to do this.
Tpx
source share