Welcome to the new Box Support website. Check out all the details here on what’s changed.

Ability to create preview pngs (for PowerPoint pages)

Answered
New post

Comments

3 comments

  • tonyjin

    Hello janmechtel,

     

    Have you seen our Preview Element JS library? https://developer.box.com/docs/box-content-preview This is the same library that powers the Preview API as well as Preview in the main Box web application. Using the library, you should be able to render a preview inline without using an iframe.

     

    Best,

    Tony

    0
    Comment actions Permalink
  • janmechtel

    Thanks for the feedback Tony, the target application ins .net C# inside Microsoft Office.

     

    Also we'd like to cache the previews for speed. Is there a way for us to download the .pngs?

     

    Thanks,

     

    Jan

     

    0
    Comment actions Permalink
  • tonyjin

    Because the representations are authenticated, unless you cache the representation using the same access token you give to Preview and using the same method Preview (access token either as query param or header) uses for that specific file type, the browser cache won't work since URLs may not match. Also, since we don't use pngs to display documents (we actually send a PDF representation of PowerPoint files to the client, which renders the file using pdf.js), caching pngs wouldn't help.

     

    You can look into using the 'prefetch' function in preview.js (https://github.com/box/box-content-preview/blob/master/src/lib/Preview.js#L458) to prefetch representation content in advance, which will improve performance as long as you use the same access token you'll eventually call preview.show() with.

    0
    Comment actions Permalink

Please sign in to leave a comment.