Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Images are not being rendered in the pdf generated.

$
0
0
 string url = HttpContext.Current.Request.Url.AbsoluteUri;
            string WebUrl = url; //"http://localhost:53352/Login.aspx";
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(WebUrl);
            request.Timeout = 10000;
            HttpWebResponse localWebResponse = (HttpWebResponse)request.GetResponse();

            Encoding encoding = Encoding.GetEncoding(1252);

  StreamReader localResponseStream = new    StreamReader(localWebResponse.GetResponseStream(), encoding);
            Pdf pdf = new Pdf();
            pdf.HtmlInfo.ExternalResourcesBasePath = "http://localhost:53352/";
            Section section = pdf.Sections.Add();
            Text text2 = new Text(section, localResponseStream.ReadToEnd());
            text2.IsHtmlTagSupported = true;
            text2.IfHtmlTagSupportedCssWinsOnFirstLevelChildren = true;
            text2.IsAlignedByWord = true;
            text2.IsFitToPage = true;
            text2.IsKeptWithNext = true;
            section.Paragraphs.Add(text2);
            pdf.Save(@"D:\HtmlToPdf.pdf");

            localWebResponse.Close();
            localResponseStream.Close();

Viewing all articles
Browse latest Browse all 3131

Trending Articles