VintaSoft Imaging .NET SDK and Plug-ins Discussions

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Board index < VintaSoft Imaging < VintaSoft Imaging .NET SDK and Plug-ins Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

saveChanges method throw error when used with multiple image



saveChanges method throw error when used with multiple image

Post by jwalit.katira »

Hello ,

I have open multiple images in web document viewer using array below is the sample code
let images = [
      "0.jpg",
      "1.jpg",
      "2.jpg",
    ];

imageViewer.get_Images().openFiles(images);
After that we have deleted 0.jpg and save that changes using below code
let index = docViewer.getFocusedIndex();
    docViewer.removePage(index);
    docViewer.saveChanges();
The above code sent .Net core API request "MyVintasoftFileApi/SaveImageFile" to save the changes , below is the request
{
  "fileId": "0.jpg",
  "createNewFile": false,
  "imageInfos": [
    {
      "fileInfo": {
        "id": "1.jpg"
      },
      "pageIndex": 0
    },
    {
      "fileInfo": {
        "id": "2.jpg"
      },
      "pageIndex": 0
    }
  ],
  "sessionId": "SessionID"
}
But it in response we are getting error of "Single-page encoder cannot be used because collection contains more than one image" , below is the response
{
    "fileId": "0.jpg",
    "success": false,
    "blocked": false,
    "errorMessage": "Single-page encoder cannot be used because collection contains more than one image.\r\n",
    "requestId": null
}
Can you please share how can we resolve this error

Thanks
Jwalit Katira


Re: saveChanges method throw error when used with multiple image

Post by Alex »

Hello Jwalit,

You have error because WebDocumentViewerJS.saveChanges function cannot save 2 JPEG images to a JPEG file because JPEG file can store 1 image only.

Please use WebDocumentViewerJS.exportFile or WebDocumentViewerJS.exportAndDownloadFile functions and save 2 JPEG images to a TIFF or PDF file.

Best regards, Alexander


Page 1 from 1: 1