Free Support Forum - groupdocs.com

Error Viewing Multiple Streams


#1

Hi,


I’m having an error viewing multiple documents using the viewer in an ASP.NET application. Please see code below which is giving an Object Reference error. Using Viewer.ClientCode().Stream(this.ByteStream, this.FileName, this.Extension, this.DownloadFileName) however works perfectly as expected.

CodeBehind
public StreamDefinition[] streamDefinitions;
protected void Page_Load(object sender, EventArgs e)
{
streamDefinitions = new StreamDefinition[]
{
new StreamDefinition()
{
FilenameExtension = Properties.Settings.Default.DefaultFormat,
Stream = new FileStream(Server.MapPath(Properties.Settings.Default.DefaultImage), FileMode.Open, FileAccess.Read, FileShare.Read)
}
};
}

Page
<%= Viewer.ClientCode()
.TargetElementSelector("#MainViewerWindow")
.Streams(this.streamDefinitions)
.OpenThumbnails(false)
.SupportPageRotation(true)
.ZoomToFitHeight()
%>

Please advise if this is an issue on my side or if there is an error in the DLL?

#2

Hello Ian,

We are sorry to hear that you have this issue. Thank you for providing a source code, it has helped to reproduce the issue. It is a bug inside the GroupDocs.Viewer, an exception occurs when there is one and only one item in the array (or any other sequence like list, the specific type does not matter). If there is more then one item, the exception doesn’t occur and GroupDocs.Viewer shows several documents.

Our developers are working on this bug. We will notify you in this forum thread when it will be fixed.

Thanks and sorry for the inconvenience.


#3

Hello Ian,

Just want to notify you that this issue was fixed in the recently released GroupDocs.Viewer version 2.8.

Thanks.