I created a document (see attached) using Aspose.Word document builder code. Then I use code much like the demo's SendToBrowserAsPdf(Document doc) to convert it to pdf and display it in a browser. However, I get usually one of two errors:
Exception Details: System.ApplicationException: Previous heading must be set in when insert heading in API.
Line 131: //Now produce the PDF file.
Line 132: pdf.Save("Aspose.Word.Demos.pdf", Aspose.Pdf.SaveType.OpenInBrowser, this.Response);
Line 133: }
Or I get an error in the Adobe Reader like:
"Adobe Reader could not open 'pa030961.fdf' because it is either not a
supported file type of because the file has been corrupted."
Also sometimes it does actually display in the reader. This is an evaluation version, so perhaps the evaluation inserted garbage characters are causing the differences.
Other similar documents work just fine so I am pretty mystified by the errors.