see my below code iam not able to write html image into word document and also in pdf?
when i kept image tag src as c:\winter.jpg it is working …if i kept image tag src as url i mean http://wkt002:20649/SelectImage.aspx?ImageID=8 it is not wokring in this case…pls help me out…
Thanks for your inquiry. Unfortunately, I was unable to reproduce this issue on my side. Could you please create and attach here a simple little console application that enables me to reproduce this issue on my side? I will investigate the issue further and provide you more information.
Hi,
Thanks for the additional information. I have made a few corrections to your code. Please try using the following code snippet and let us know how it goes on your side?
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
string html = @"<p><img src='http://cdn.aspose.com/homepage/images/logo.png' alt='Aspose logo'width='230' height='70' /></p>";
builder.InsertHtml(html);
doc.Save(@"c:\temp\out.pdf");
i tried in the way wht u said it is not working…see atatched pdf…pls help me out…when i pasted tht image src path in browser separately it was working fine…when i kept here in code it was not working fine…
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
string html = @"<img src='http://www.orkutbuddy.com/albums/glitters/cartoon/cartoons_20_63_.gif alt='test image' width='178' height='129' />";
builder.InsertHtml(html);
doc.Save(@"C:\work.pdf");
even i tried with ur url http://cdn.aspose.com/homepage/images/logo.png it is not working…see sample pdf attached …if i open ur url in browser i mean in separate window it was working fine…pls help me out…wht was the problem iam not getting…
Hi,
Thanks for your inquiry.
While using Aspose.Words v11.4.0 and the following code, I was unable to reproduce this issue on my side. I have attached the PDF file (out.pdf) i.e. generated on my side here for your reference.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
string html = <span style="color:#A31515">@"<img src='http://cdn.aspose.com/homepage/images/logo.png' alt='Aspose logo'width='230' height='70' />";
builder.InsertHtml(html);
doc.Save(<span style="color:#A31515">@"c:\temp\out.pdf");
Moreover, Could you please double check if you are using the latest version (11.4.0)? You can dynamically check if you’re referencing the correct DLL by using the following code snippet:
System.Reflection.Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
foreach (System.Reflection.Assembly assembly in assemblies)
{
System.Reflection.AssemblyName assemblyName = assembly.GetName();
if (assemblyName.Name.Contains("Aspose.Words"))
Console.WriteLine("Aspose.Words Version Number: " + assemblyName.Version.ToString());
}