We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Image position and text overwrite

Hi Team,

I am trying to convert web to pdf using aspose.pdf for .net but image in pdf is not showing(align) properly and text overwrite itself.
Please refer to the code below-

string url = “https://www.sec.gov/Archives/edgar/data/320193/000119312517003753/d257185ddef14a.htm”;
System.Net.WebRequest request = System.Net.WebRequest.Create(url);
request.Credentials = System.Net.CredentialCache.DefaultCredentials;
System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)request.GetResponse();
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string content = reader.ReadToEnd();
reader.Close();
dataStream.Close();
response.Close();
HtmlLoadOptions htmlLoadOptions = new HtmlLoadOptions(url);
htmlLoadOptions.PageInfo.Margin.Bottom = 10;
htmlLoadOptions.PageInfo.Margin.Top = 20;
//Load HTML string
Document doc = new Document(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(content)), htmlLoadOptions);
//Save PDF file
doc.Save(@“C:\sd.pdf”);

Hi Asad,


Thanks for contacting support.

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; -webkit-text-stroke: #000000} span.s1 {font-kerning: none}

I have tested the scenario and have managed to reproduce the problem that after conversion from web to PDF some image positions and text overlaps. For the sake of correction, I have logged it as PDFNET-42291 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time.


We are sorry for this inconvenience.


Best Regards,