I have the following code that converts a blob from a database to an image url ( WebControls.Image
):
OracleCommand cmd2 = new OracleCommand();
cmd2.Connection = conn1;
cmd2.CommandText = "select simbolo from simbolos_ll where idsimb=" + id;
OracleDataReader dr2 = cmd2.ExecuteReader();
dr2.Read();
OracleLob blob = null;
blob = dr2.GetOracleLob(0);
byte[] bytes = (byte[])blob.Value;
string base64String = Convert.ToBase64String(bytes, 0, bytes.Length);
url = "data:image/png;base64," + base64String;
This way I pass it to a List<string>
to have the urls of the Img
stored (I do it in the code but I do not want to show a tochaco):
List<string> imgPDF = new List<string>();
Starting from this point, I have to: With the URL of the image create a itextSharp.Image
.
iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(imagenesPDF[idBlob-1]);
And I miss the following error:
"The URI prefix is not recognized."
The question is this:
Having the url
of the image, how can I create the image of itextSharp.Image
?