I’m getting an “Object reference not set to an instance of an object” exception when calling document.Save()
Code:
ComponentInfo.SetLicense(ImportUtils.gemBoxSerialKey);
ComponentInfo.FreeLimitReached += (sender, e) => e.FreeLimitReachedAction = FreeLimitReachedAction.ContinueAsTrial;
var document = DocumentModel.Load(uploadedFilePath);
CapturerByText capturer = new CapturerByText(document, null);
// Convert the document to HTML string
var saveOptions = new HtmlSaveOptions()
{
HtmlType = HtmlType.HtmlInline,
EmbedImages = true,
UseSemanticElements = false
};
string htmlName = $"{Guid.NewGuid()}_Exported.html";
// Save DocumentModel object to HTML (or MHTML) file.
document.Save(htmlName, saveOptions);
Exception: Object reference not set to an instance of an object.
Stacktrace:
