I've upgraded to 3.3 and see much improvement in the handling of MSG files, but still have problems get HTML pages rendered from attachments. I've tried 4 msg files with attachments and have problems with all but one of them. In each case I've successfully viewed the document when it was not an attachment.
The error occurs during the GetPages call in this loop:
foreach (AttachmentBase attachment in docInfo.Attachments)
try
{
viewerHandler.GetPages(attachment, opt);
}
catch (Exception ex)
{
app.LogMsg("DocumentViewer attachment exception on " + attachment.SourceDocumentGuid + " - " + attachment.Name, "ERROR");
app.LogMsg(ex.Message + "
" + ex.StackTrace, "ERROR");
}
I get two different kinds of stack traces depending on whether the attachment is an xlsx file or a docx file. For XLSX the stack looks like this:
Object reference not set to an instance of an object.
()
at .
(FileDataOptions )
at .(FileDataOptions )
at GroupDocs.Viewer.Handler.ViewerHandler`1.GetFileData(ViewerConfig viewerConfig, IInputDataHandler inputDataHandler, ICacheDataHandler cacheDataHandler, ILocalizationHandler localizationHandler, FileDescription fileDescription, ConverterOptions converterOptions)
at GroupDocs.Viewer.Handler.ViewerHandler`1.(ConvertOptions , ConverterOptions )
at GroupDocs.Viewer.Handler.ViewerHandler`1.GetPages(Stream fileStream, String fileName, ConverterOptions converterOptions)
at GroupDocs.Viewer.Handler.ViewerHandler`1.GetPages(AttachmentBase attachment, ConverterOptions converterOptions)
at GroupDocs.Viewer.Handler.ViewerHtmlHandler.GetPages(AttachmentBase attachment, HtmlOptions htmlOptions)
at Handshake.GroupDocs.CacheManagement.ThreadStart_UpdateDocumentCache(Object args) in C:\TFS Projects\Active\Unreleased\Server\HandshakeWebServices\Handshake.GroupDocs\CacheManagement.cs:line 259
For a DOCX file the stack trace is:
File type 'docx' is not supported.
at
at
at
at .(FileDataOptions )
at .(FileDataOptions )
at GroupDocs.Viewer.Handler.ViewerHandler`1.GetFileData(ViewerConfig viewerConfig, IInputDataHandler inputDataHandler, ICacheDataHandler cacheDataHandler, ILocalizationHandler localizationHandler, FileDescription fileDescription, ConverterOptions converterOptions)
at GroupDocs.Viewer.Handler.ViewerHandler`1.(ConvertOptions , ConverterOptions )
at GroupDocs.Viewer.Handler.ViewerHandler`1.GetPages(Stream fileStream, String fileName, ConverterOptions converterOptions)
at GroupDocs.Viewer.Handler.ViewerHandler`1.GetPages(AttachmentBase attachment, ConverterOptions converterOptions)
at GroupDocs.Viewer.Handler.ViewerHtmlHandler.GetPages(AttachmentBase attachment, HtmlOptions htmlOptions)
at Handshake.GroupDocs.CacheManagement.ThreadStart_UpdateDocumentCache(Object args) in C:\TFS Projects\Active\Unreleased\Server\HandshakeWebServices\Handshake.GroupDocs\CacheManagement.cs:line 259
Again, the DOCX file that was attached to the email works fine if I render it from a DOCX instead of within an MSG.
I've uploaded a zip file with 3 messages that demonstrate the problem.
Thanks,
Don