Page 1 of 1

Cannot create decoder for file.

Posted: Tue Mar 15, 2022 5:42 pm
by Johnsnow
Hi,

When I running project on localhost and opening file in document viewer its working as expected, but when I hosted application on IIS its throwing this error "Cannot create decoder for "{Network Path}\PDF2.pdf" file."

I am using this code to initialize document viewer

Code: Select all


// create the document viewer settings
    var docViewerSettings = new Vintasoft.Imaging.DocumentViewer.WebDocumentViewerSettingsJS("documentViewerContainer", { annotations: true });

    // initialize main menu of document viewer
    __initMenu(docViewerSettings);

    // initialize side panel of document viewer
    __initSidePanel(docViewerSettings);

    // initialize image viewer panel of document viewer
    __initImageViewerPanel(docViewerSettings);

    // create the document viewer
    _docViewer = new Vintasoft.Imaging.DocumentViewer.WebDocumentViewerJS(docViewerSettings);
and this code to open file

Code: Select all

_docViewer.openFile(filePath);
Please advise.

Thanks,
John

Re: Cannot create decoder for file.

Posted: Tue Mar 15, 2022 8:06 pm
by Alex
Hi John,

You have the problem because VintaSoft Imaging .NET SDK cannot create decoder for PDF document because the SDK cannot find Vintasoft.Imaging.Pdf.dll assembly. For solving the problem please add reference to the Vintasoft.Imaging.Pdf.dll assembly to your ASP.NET project.

Best regards, Alexander

Re: Cannot create decoder for file.

Posted: Wed Mar 16, 2022 7:36 am
by Johnsnow
Hi Alex,

I had already included following dlls

Vintasoft.Barcode.AspNetCore.ApiControllers.dll
Vintasoft.Barcode.dll
Vintasoft.Barcode.Web.Services.dll
Vintasoft.Imaging.Annotation.AspNetCore.ApiControllers.dll
Vintasoft.Imaging.Annotation.dll
Vintasoft.Imaging.Annotation.Pdf.dll
Vintasoft.Imaging.Annotation.UI.dll
Vintasoft.Imaging.Annotation.Web.Services.dll
Vintasoft.Imaging.AspNetCore.ApiControllers.dll
Vintasoft.Imaging.dll
Vintasoft.Imaging.Office.OpenXml.dll
Vintasoft.Imaging.Pdf.dll
Vintasoft.Imaging.UI.dll
Vintasoft.Imaging.Web.Services.dll
Vintasoft.Shared.dll
Vintasoft.Shared.Web.dll

But getting same error "Cannot create decoder for file" in all files (jpg, png, tiff, pdf, docx etc.)

Please advise.

Thanks,
John

Re: Cannot create decoder for file.

Posted: Wed Mar 16, 2022 8:56 am
by Alex
Thank you for information.

By default VintaSoft Web services use folder "UploadedImageFiles" for storing uploaded file. Also web services use folder "VintasoftCache" for storing cache files (image tiles, thumbnails, annotations, etc). Folders "UploadedImageFiles" and "VintasoftCache" must have read-write access for IIS user.

I think you have problem because you have not created folders "UploadedImageFiles"/"VintasoftCache" or you have not provided read-write access to the folders.


If you want to disable caching in web image viewer (do not store image tiles in "VintasoftCache" folder), please read how to do this in "Caching images on the server" section here: https://www.vintasoft.com/docs/vsimagin ... owser.html

If you want to disable caching in web thumbnail viewer (do not store thumbnails in "VintasoftCache" folder), please read how to do this in "Caching thumbnails on the server" section here: https://www.vintasoft.com/docs/vsimagin ... owser.html

If you do not want to store uploaded files in "UploadedImageFiles" files, you can override behavoiur of web service.
If you want to store uploaded files in database, please read how to do this here: https://www.vintasoft.com/docs/vsimagin ... abase.html


VintaSoft Imaging .NET SDK has open architecture and allows to override any behaviour of SDK.

Best regards, Alexander