We are running into an issue with GroupDocs.Conversion v26.1.0 when trying to convert a presentation document that contains broken summary links.
We get the following exception:
GroupDocs.Conversion.Exceptions.GroupDocsConversionException: Value cannot be null. (Parameter 'key')\r\n ---> System.ArgumentNullException: Value cannot be null. (Parameter 'key')\r\n at e.(Exception , ConverterSettings \b, \b )\r\n at e.\b(CancellationToken )\r\n at e.\b.()\r\n at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)\r\n--- End of stack trace from previous location ---\r\n at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)\r\n --- End of inner exception stack trace ---\r\n at e..(Exception )\r\n at System.AggregateException.Handle(Func`2 predicate)\r\n at e.(CancellationToken )\r\n at GroupDocs.Conversion.Converter.(CancellationToken )\r\n at GroupDocs.Conversion.Converter.Convert(ConvertOptions convertOptions, Action`1 documentCompleted, CancellationToken cancellationToken)\r\n
We used the following code and file to reproduce this issue:
Pictures and SmartArt - Summary Section is broken - small.zip (44.8 KB)
[Test]
public async Task Converting_PresentationWithBrokenSummaryLinks_ThrowsException()
{
// Arrange
var filename = "Pictures and SmartArt - Summary Section is broken - small.pptx";
var path = Path.Combine(TestContext.CurrentContext.TestDirectory, "TestData", "Presentation", filename);
await using var originalDocument = File.Open(path, FileMode.Open);
// Act
using var converter = new Converter(
() => originalDocument,
context =>
{
var loadOptions = new PresentationLoadOptions
{
ShowHiddenSlides = true,
SkipExternalResources = true,
ClearBuiltInDocumentProperties = true,
ClearCustomDocumentProperties = true,
NotesPosition = PresentationNotesPosition.BottomFull,
};
return loadOptions;
});
using var outputStream = new MemoryStream();
var options = new PdfConvertOptions
{
PdfOptions = new PdfOptions
{
Linearize = true,
},
};
var action = () => converter.Convert(
options,
(ConvertedContext convertedContext) =>
{
convertedContext.ConvertedStream.Position = 0;
convertedContext.ConvertedStream.CopyTo(outputStream);
});
var exception = action.Should().Throw<GroupDocsConversionException>().Which;
}
Is there a way we can convert this file without this throwing an exception? Ideally in a similar manner to what happens when one saves the presentation as a PDF.