Xlsx to xls conversion

Hi Team,
We are trying to convert a simple xlsx file to xls.
We are using the following code to do this.
var converter = new gd.Converter(returnStream);
var xlsconverterOptions = converter.GetPossibleConversions()[“xls”].ConvertOptions;

converter.Convert(() => new MemoryStream(), (convertedStream, _) => convertedStream.CopyTo(storingStream), xlsconverterOptions);

public Stream returnStream()
{
return streamtoPass;
}

the streamtoPass is the input stream.
It is working fine till converteroptions. but when it hits conversion line the stream is automatically getting disposed and we are getting null reference exception. Kindly help.

1 Like

@ABC123gdforum

Please specify following details and we’ll look into this scenario:

  • Sample/problematic file
  • GroupDocs.Conversion for .NET API versionthat you are using
  • Do you have a license or evaluating the API in trial mode?
  • Development environment details (e.g. .NET, OS version)

@atir.tahir
Its working fine when we are accessing the file from the file path. This error occurs only when we try to store the converted file into a stream in the third line.

Yes, we have licensed version for groupdocs 23.3.0.

@ABC123gdforum

We cannot reproduce this issue when saving to stream using this example code. Would you mind utilizing this code?

Please share all above details if issue persists.