c# - Inputting image data to PDF with iText -


i have imagebutton in website has dynamic source looks this: "data:image/svg+xml;base64,...."

so trying insert image in pdf using that. code use

itextsharp.text.image image = itextsharp.text.image.getinstance(new uri(((imagebutton) findcontrol(fieldkey)).imageurl)); 

i either "the uri empty" error or path not found.

any ideas how approach this?

i doubt google figured out why not post anwser.

to implement data img types in pdf remove prefix part , convert base 64 in array byte.

string thesource = ((imagebutton)findcontrol(fieldkey)).imageurl.replace("data:image/png;base64,", ""); itextsharp.text.image image = itextsharp.text.image.getinstance(convert.frombase64string(thesource)); 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -