2

how to add image file with itextSharp in asp.net C#. And which namespace is required

Image jpg** = Image.GetInstance(new Uri(URL))
2
  • 1
    For this purpose there is a documentation... Commented Apr 10, 2013 at 9:24
  • 1
    Possible duplicate of stackoverflow.com/questions/4325151/… Commented Apr 10, 2013 at 9:27

2 Answers 2

1

You can use iTextSharp.text.Image for adding images. Something like this:

iTextSharp.text.Image pic = iTextSharp.text.Image.GetInstance(image, System.Drawing.Imaging.ImageFormat.Jpeg);
myDocument.Add(pic);

Where myDocument is the object of Document Class of itextsharp

Here if one details article which discuss handling images in itextsharp

http://www.mikesdotnetting.com/Article/87/iTextSharp-Working-with-images

and may be you might be interested in going through documentation also, so here is the link:

http://sourceforge.net/projects/itextsharp/

Sign up to request clarification or add additional context in comments.

Comments

0

You can try this

using(Stream ImageStream = new FileStream(imageUrl, FileMode.Open, FileAccess.Read, FileShare.Read))

Image image = Image.GetInstance(ImageStream);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.