Hello Aspose Team,
I want to convert a html page into the pdf. Following is html code for my page.
and following is my server side code.
using System;
using Aspose.Pdf.Generator;
using System.IO;
namespace PDFGeneration
{
public partial class Image : System.Web.UI.Page
{
protected void btnCreatePDF_Click(object sender, EventArgs e) {
Pdf pdf=new Pdf();
Section section=pdf.Sections.Add();
StreamReader streamReader = File.OpenText(Server.MapPath(“Image.html”));
Text text=new Text(section,streamReader.ReadToEnd()) {IsHtmlTagSupported = true,IsHtml5Supported = true};
section.Paragraphs.Add(text);
streamReader.Close();
pdf.HtmlInfo.ImgUrl = “~/Images”;
pdf.Save(Server.MapPath(“PDF”) + @“\Image.pdf” );
Response.Write(“Pdf genreated successfully”);
}
}
}
PDF created successfully. But Image is not there in PDF. Let me know what I have to do for that.
Regards,
Jalpesh