We're using Spire.Doc to convert files to images in order to show a file preview on our website without giving access to the actual files. We recently bought a license and started using the full version, and now every time we try to load a HTML file we get an exception with the message "Input string was not in a correct format." We're not sure why Spire.Doc is unhappy with the files as the error message does not elaborate. The files open in a browser just fine.
We've tried the following approaches, and all result in the same error message:
- Code: Select all
var document = new Spire.Doc.Document();
document.LoadFromFile(tempFile, Spire.Doc.FileFormat.Html);
var images = document.SaveToImages(startIndex, pages, Spire.Doc.Documents.ImageType.Bitmap);
- Code: Select all
var document = new Spire.Doc.Document();
document.LoadFromFile(tempFile);
var images = document.SaveToImages(startIndex, pages, Spire.Doc.Documents.ImageType.Bitmap);
- Code: Select all
var document = new Spire.Doc.Document();
document.LoadFromFile(tempFile, Spire.Doc.FileFormat.Html, Spire.Doc.Documents.XHTMLValidationType.None);
var images = document.SaveToImages(startIndex, pages, Spire.Doc.Documents.ImageType.Bitmap);
Are there some typical things that can cause this error?
We're also having similar issues with XML files, there the error is "The file format cannot be supported."
Any help would be appreciated.
/Markku Eerola,
PRObank