Cannot add more than one photo to viewer

WebViewer Version: 10.11.1

Do you have an issue with a specific file(s)? No.
Can you reproduce using one of our samples or online demos? No.
Are you using the WebViewer server? No.
Does the issue only happen on certain browsers? No. (Tested with Firefox and Chrome.)
Is your issue related to a front-end framework? Unlikely. (We use React, but I don’t believe it’s part of the problem here.
Is your issue related to annotations? No.

Please describe your issue and provide steps to reproduce it:

With no document in the viewer:

  • Drag and drop a single image into the thumbnail viewer. You can not add any more files of any type to the document. (Document.getType() returns "image")
  • Drag and drop multiple images into the thumbnail viewer. Only the first loads. You cannot add any more files of any type to the document. (Document.getType() returns "image")
  • Drag and drop a PDF into the thumbnail panel. It loads. Drag and drop any number of image files into the thumbnail viewer. They all load. (Document.getType() returns "pdf")

It seems that to work around this, I just need to detect the documentLoaded event and convert the image document to a pdf document, but how do I do the conversion?

Hello Duncan,

You have two ways of loading the file like a PDF. Both of them use the loadAsPDF: true option. You do not need to do any conversion during the documentLoaded event.

instance.UI.loadDocument('image.jpg', { loadAsPDF: true });
WebViewer(
      {
        path: '/webviewer/lib',
        initialDoc: 'image.jpg',
        loadAsPDF: true,
        l: 'your-license-key'
      },

Best Regards,
Darian

Does this mean that, despite having loadAsPDF set in my initializer, loading image files by dropping them into the thumbnail panel and getting an image-type document is expected behavior?

Hello Duncan,

There may be an issue with the drag and drop functionality. You should be able to insert new documents by selecting the three dots and clicking on insert.

I have submitted a report to the product team about the drag and drop issue.