I have 2 examples of Microsoft Word .docx files that cannot be processed using the Spire.Doc version 5.7 and Spire.Office 2.14 components. I am using the example toPDF project as a test harness with the following code.
- Code: Select all
FileStream fileStream = System.IO.File.Open(@"C:\Users\richard\Downloads\ProblemFile1.docx", FileMode.Open);
document.LoadFromStream(fileStream, Spire.Doc.FileFormat.Auto);
Spire.Pdf.PdfDocument pdfdoc;
using (MemoryStream stream = new MemoryStream())
{
document.SaveToStream(stream, Spire.Doc.FileFormat.PDF);
document.Close();
pdfdoc = new Spire.Pdf.PdfDocument(stream);
}
My concern with these failures is that the process either never returns a result/error code or if it does, it throws a StackOverflowException which cannot be caught and handled gracefully.
I have tried the files using the iceblue Spire online conversion web page resulting in a Server Error after a considerable time. I can provide the example files by email if necessary. The files also cause problems for some similar conversion services however there are products that will handle them.
Is it possible to
1. Process the file examples without error
2. When an error or incompatibility occurs, retrieve an error code or report on what the issue is.
3. Allow the application to continue and process further documents
Many thanks
Richard