0

I am using signaturepad.js that allows me to draw an image. I need to import that image onto the pdf in a specific location. Any ideas?

misha130 suggests:

string theSource = ((ImageButton)FindControl(fieldKey)).ImageUrl.Replace("data:image/png;base64,", "");
iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(Convert.FromBase64String(theSource));

https://stackoverflow.com/a/19247423/1814205

Community
  • 1
  • 1
andyval
  • 31
  • 2
  • Does the code you posted not work, not work as expected or cause an exception? – Chris Haas Mar 06 '15 at 20:05
  • i don't really understand what he did or how to fully implement his solution into my code. – andyval Mar 06 '15 at 22:00
  • I don't know anything about signaturepad.js but you should be able to divide this into a couple of steps. #1) Get an actual image from signaturepad.js and physically save it to the server as `whaterver.png`. If this is not possible then stop here. #2) Use the previous image in iTextSharp like you normally would. #3) Once you've got the flow, tweak step 1 to not actually save to disk but save to memory instead. – Chris Haas Mar 07 '15 at 14:56

0 Answers0