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.

Wed Jun 10, 2015 11:23 am

Hi

The following snippet is consistently throwing 'Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index'

(a.FilePayload is a varbinary)
Code: Select all
var a = await db.DocumentStore.FirstOrDefaultAsync(x => x.GUID == id);
using (Stream ms = new MemoryStream(a.FilePayload, true))
{
      Document d = new Document(ms, FileFormat.Doc); <-- Exception here
      MemoryStream _out = new MemoryStream();
      d.SaveToStream(_out, FileFormat.PDF);
      return File(_out, "application/pdf");
}


I've successfully been able to use word interop to convert this so the payload is fine, any ideas?
any help appreciated

vanamonde
 
Posts: 1
Joined: Wed Mar 05, 2014 2:56 pm

Thu Jun 11, 2015 9:05 am

Hello,

Thanks for your inquiry.
Please provide your stream file to us here, or you can send it to us( support@e-iceblue) via the email. We will have a test and update to you soon.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Fri Jun 12, 2015 9:45 am

Hello,

Could you provide your stream file to us here, or you can send it to us( support@e-iceblue) via the email?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Return to Spire.Doc