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?

1 Like

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

1 Like

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?

1 Like

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.

1 Like

We are seeing the same issue when drag/drop more than one png file in this scenario. I can also reproduce it in your online demo. Just insert a new page, click the upload tab and then drag more than one png file to upload. Triggers an error every time.

1 Like

Hello Betsy,

Are you loading a png file in the viewer first? I was not able to insert a new png and cause an error.

1 Like

Do you mean is the original file a png? No, it is a pdf so it would be mixing pdf and png file types. I uploaded a screenshot of the error in case that is helpful.

1 Like

Hello Betsy,

I was able to reproduce this issue. I don’t think this is exactly the same issue as the one above. I have submitted a report to the product team.

1 Like