UnsupportedImageFormat with stream

Discussions about DocuVieware integration in GdPicture.NET.
Post Reply
jeremyg
Posts: 1
Joined: Wed Sep 20, 2017 10:41 am

UnsupportedImageFormat with stream

Post by jeremyg » Wed Sep 20, 2017 10:51 am

Hello,

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";
}
@Scripts.Render("~/bundles/docuvieware")
@Styles.Render("~/Content/docuvieware")

<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
            {
            <script>
                        // 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);
            </script>
            }

                //docuVieware.RenderControl(Output);
         }
     }
</div>
But unfortunately I have an alert with the UnsupportedImageFormat error.

Do I miss something to specify for the format?

Thanks a lot

Cedric
Posts: 259
Joined: Sun Sep 02, 2012 7:30 pm

Re: UnsupportedImageFormat with stream

Post by Cedric » Fri Nov 03, 2017 3:14 pm

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.

http://www.docuvieware.com/guides/aspne ... ring).html

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest