I'm looking specifically for something comparable the following code that we use with ActivePdf's PDF Toolkit library:
- Code: Select all
PdfObject.ImageByteArray = image;
PdfObject.SetFormFieldData(field, "MEMORY", -996);
Additionally, they also provide support for loading an image from the filesystem into a form field, like this:
- Code: Select all
PdfObject.SetFormFieldData(“fieldname”, “c:\pathtoimage\image.jpg”,-995)
My preference is to not load from the filesystem, being that we pull the image from the database and work with it as a byte array in memory.
EDIT:
I've also looked into PdfSharp as an option. They have the following method for adding an image to a text field:
- Code: Select all
PdfObject.AcroForm.Fields[field].CreateStream(image)