vb.net - iTextSharp - How to input image (PNG) from project resource? -
I have iTextSharp for me making a PDF in VB.net. Everything was working well, except now I want to embed an image. I tried to do this:
dim test = my.resources.my image dim logo = picture. GetInstance (test)
This is an error though:
It appears as if it would expect a path , And getting a system. Drawing Bitmap type
Is there any way that I can add project resource images to my PDF? thank you in advanced!
One of the overloads for iTextSharp.text.Image.GetInstance ()
A system.Drawing.Image
, so change your PNG resource in such a way and then use this surcharge. Something like this:
Dim check as the system. Drawing Image = system Drawing Image. FramesHitmap (). Dim Logo ITextSharp.text.Image = ITextSharp.text.Image.GetInstance (Testing, System.Drawing.imaging.ImageFormat.Png)
Comments
Post a Comment