Hello,
I was trying the .net version of aspose.pdf, and I was trying to render an html page (google page in this case) to .pdf. But when I use pdf.save, it gives me an "Object not set to an instance of an object."
Here's my code, am I doing something wrong?
StreamReader localResponseStream = File.OpenText(inputFileName);
// Instantiate an object PDF class
Pdf pdf = new Pdf();
// add the section to PDF document sections collection
Aspose.Pdf.Section section = pdf.Sections.Add();
//Create text paragraphs containing HTML text
Aspose.Pdf.Text text2 = new Aspose.Pdf.Text(section, localResponseStream.ReadToEnd());
// enable the property to display HTML contents within their own formatting
text2.IsHtmlTagSupported = true;
// Add the text object containing HTML contents to PD Sections
section.Paragraphs.Add(text2);
// Specify the URL which serves as images database
//pdf.HtmlInfo.ImgUrl = "http://en.wikipedia.org/";
//Save the pdf document
pdf.Save(outputDir);
localResponseStream.Close();
Thanks