Last post Oct 18, AM by Mikesdotnetting. Currently I have it on the database but I am wondering whether this is not the correct way to go or I will not be able to display it on the pdf document.
C# Tutorial 44: iTextSharp : Working with images in iTextSharp PDF file using C#
All examples found are retrieving images from a physical path on the server. If the easiest way is to use ashx which cannot be used in itextsharp, will this fit to your requirements? There is no need to store a temporary copy on the server.
The Image. GetInstance method accepts a byte array as well as a file path.
I don't know what your model is like but assuming you have a File table with a FileContent column containing the binary data, your code might look like this:. Can this be converted to iTextSharp.
Image and displayed on the PDF? You don't actually need to save it to disk.
By continuing to browse this site, you agree to this use. Learn more. Print Share Twitter Facebook Email.
OR It is better to store the image physically on the server and access it using filesystem path. Any example with retrieving image from db and insert it on the PDF using Itextsharp?
GetInstance doc, new FileStream Server. Create ; doc. GetInstance byte file. FileContent ; doc.
Converting PDF document to byte
Add image ; doc. If yes how can I do it? If there is another way to go also please let me know Thanks.