Page 1 of 1

UnsupportedImageFormat with stream

Posted: Wed Sep 20, 2017 10:51 am
by jeremyg

width docuwieware lite, I try to display pdf and images in the viewer from streams received from a webservice with this code

Code: Select all

@using GdPicture14.WEB
@using GdPicture14
@using Isagri.GED.External.V2_10.StorageCabinet
@model ExternalDocumentStreamResponse

    ViewBag.Title = "Visualisation";

<div id="viewer_container">
        DocuVieware docuVieware = new DocuVieware
            ID = "DocuVieware1",
            Height = new System.Web.UI.WebControls.Unit("500px"),
            Width = new System.Web.UI.WebControls.Unit("100%"),


        if(Model != null)
            GdPictureStatus status = docuVieware.LoadFromStream(Model.Stream, true);
            if (status != GdPictureStatus.OK) // If LoadFromStream failed, we want to display the error status
                        // setTimeout allows the page to keep loading even with the alert so the UI isn't frozen until user clicks OK
                        setTimeout(function () { alert("An error occured: @status"); }, 1);

But unfortunately I have an alert with the UnsupportedImageFormat error.

Do I miss something to specify for the format?

Thanks a lot

Re: UnsupportedImageFormat with stream

Posted: Fri Nov 03, 2017 3:14 pm
by Cedric
There is unfortunately not much we can do with so little information.

You should consider using the overload that takes an extra parameter that is the file name, in case the file you're truing to load does not have any header for instance, in that case if the file name is omitted, DocuVieware won't be able to determine what format the file actually is. ... ring).html