Hello there,
I have been trying to setup the new box-ui-elements Javascript preview library. I previously used the Iframe embed technique to successfully load a preview with annotations, and I was hoping to do the same thing with custom Javascript hooks on events so that I could control the user experience more directly.
Here is my code:
showBoxViewer: function (token) {
window.preview = new Box.Preview();
window.preview.show(this.resource.get('external-id'), token, {
container: '.viewer-container',
collection: [this.resource.get('external-id')],
header: 'light',
logoUrl: 'http://i.imgur.com/xh8j3E2.png',
showAnnotations: true,
showDownload: true
});
}Here is the output:
The resource I am trying to preview is a PDF, and I have previously previewed and annotated it successfully with the embedded Iframe, so I assumed it should work identically with this method. The download button works correctly, and all of the requests made by the JS library to the Box API returned 200 and had payloads related to the file I am trying to preview.
This screenshot was taken in Chrome on OSX.

