I am trying to convert a pdf into a ppt, but am getting this error. It doesn’t tell me much besides that.
Value cannot be null.
Parameter name: output
group-docs.jpg (64.1 KB)
This is the Json Response:
{"data":{"Message":"An error has occurred.","ExceptionMessage":"Value cannot be null.\r\nParameter name: output","ExceptionType":"GroupDocs.Conversion.Exceptions.GroupDocsConversionException","StackTrace":" at GroupDocs.Conversion.Converter.Convert(SaveDocumentStreamForFileType document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)\r\n at MotivUmbraco.Services.FileConverterService.<Convert>d__6.MoveNext() in C:\\MotivSolution\\Code\\MotivUmbracoV8\\Services\\FileConverterService.cs:line 34\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult()\r\n at MotivUmbraco.Controllers.MicrositeApiController.d__2.MoveNext() in C:\MotivSolution\Code\MotivUmbracoV8\Controllers\MicrositeApiController.cs:line 38\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Threading.Tasks.TaskHelpersExtensions.d__11.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"},"status":500,"config":{"method":"POST","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"/umbraco/api/MicrositeApi/ConvertToPpt","data":{},"headers":{"Accept":"application/json, text/plain, */*"}},"statusText":"Internal Server Error","xhrStatus":"complete"}
This is the class
`using GroupDocs.Conversion;
using GroupDocs.Conversion.Contracts;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
public class FileConverterService
{
private readonly Stream _stream;
public Stream OutputStream { get; private set; }
public FileConverterService(Stream stream)
{
this._stream = stream;
}
public async Task<Stream> Convert(string licensePath)
{
using (Converter converter = new Converter(GetFileStream))
{
License license = new License();
license.SetLicense(licensePath);
PossibleConversions conversions = converter.GetPossibleConversions();
SaveDocumentStream save = new SaveDocumentStream(SetOutputStream);
var convertOptions = converter.GetPossibleConversions()["ppt"].ConvertOptions;
try
{
converter.Convert(save, convertOptions);
}
catch (System.Exception ex)
{
Debug.WriteLine(ex.Message);
throw;
}
await Task.FromResult(true);
return OutputStream;
}
}
private Stream GetFileStream() => _stream;
private Stream SetOutputStream() => OutputStream;
}`
I do have a temporary license applied
What am I doing wrong?