Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Aug 26, 2019 8:56 am

Hi,

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

PRObank
 
Posts: 5
Joined: Tue Aug 20, 2019 5:31 am

Mon Aug 26, 2019 9:29 am

Hi,

Thanks for your inquiry.
To help us investigate your issue, please provide your input files.
You could upload it here, or send to us(support@e-iceblue.com) via email.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Aug 26, 2019 9:53 am

The mail is on its way.

PRObank
 
Posts: 5
Joined: Tue Aug 20, 2019 5:31 am

Mon Aug 26, 2019 10:32 am

Hi Markku,

Thanks for your information via email.
I have tested your two HTMLs with the latest Spire.Doc V7.8.12, and didn’t found the issue. But currently loading the two HTML files with Spire.Office 4.7.0 indeed has that issue, so sorry for this. We will provide a hotfix of Spire.Office which solves the issue for you ASAP.

As for XML file, note we only support Office OpenXML file format. After checking your XML file, I regret to say your XML is not Office OpenXML format file. We don’t support your XML file.

Best wishes,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc