I am using Aspose.PDF 6.9 in an ASP.NET web application to convert a web page to a PDF file. The application uses a WebRequest object to obtain the HTML, then I use BindHTML to create the PDF. The code works the first time it runs, but all subsquent attempts throw a NullReferenceException when I use the BindHTML method. If I stop the application and start it again, the code works the first time then throws NullReferenceExceptions.
The error I receive is below.
Object reference not set to an instance of an object. <?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /><o:p></o:p>
Description:
An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.NullReferenceException:
Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] ...ctor( , ) +56 ..__(& , , IList , , ‑ , ) +517 ..__(_ , , Int32 , ) +11148 ..__(_ , , Int32 , ) +13997 ..__(_ , , Int32 , ) +13997 .._(String ) +1155 .‑.__(String ) +291 Aspose.Pdf.Generator.Pdf.BindHTML(String html, String basePath) +761 BP.CME.CreatePdf.Page_Load(Object sender, EventArgs e) in C:\Transfer\VS2010\BP.CME\BP.CME\CreatePdf.aspx.cs:132 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +24 System.Web.UI.Control.LoadRecursive() +70 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3063 |