I have iTextSharp creating a pdf for me in VB.net. Everything was working famously, except now I want to embed an image. I tried this:
Dim test = My.Resources.MyImage
Dim logo = Image.GetInstance(test)
This an error though:
‘GetInstance’ cannot be called with these arguments
It appears as though it expects a path, and is getting a System.Drawing.Bitmap type.
Is there any way that I can add a project resource image to my PDF? Thanks in advance!
One of the overloads for
iTextSharp.text.Image.GetInstance()takes anSystem.Drawing.Image, so convert your PNG resource into this type and then use this overload. Something like this: