I am trying to use Aspose.PDF to convert an HTML document to PDF and then return it to the browser using an HTTP Response. The relevant code is:
Aspose.Pdf.HtmlLoadOptions plo = new Aspose.Pdf.HtmlLoadOptions();
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(filePathSource, plo);
Aspose.Pdf.PdfSaveOptions pso = new Aspose.Pdf.PdfSaveOptions();
pdfDocument.Save(response, fileName, Aspose.Pdf.ContentDisposition.Attachment, pso);
The Save triggers a System.Threading.ThreadAboortException. The exception contents are null.
Note: I am using similar code to convert Word to PDF and return as a request response. The following code works:
Aspose.Words.Document wordDocument = new Aspose.Words.Document(filePathSource);
Aspose.Words.Saving.PdfSaveOptions saveOptions = new Aspose.Words.Saving.PdfSaveOptions();
wordDocument.Save(response, fileName, Aspose.Words.ContentDisposition.Attachment, saveOptions);
Have a missed something in setting up the SaveOptions for the HTML to PDF to HTTPResponse code?