cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Display a pdf of a pdf

Display a pdf of a pdf

splnlss
Explorer | Level 3

I can use 'filesGetPreview" to view a pdf of .csv, .doc, .ai etc but how do I actually get a pdf of a pdf?? 

The "filesGetThumbnail" only returns a tiny image of a pdf or image. Is there a better way to view a pdf?

Or in other words, how is one supposed to view a file within a browser without downloading it locally?

 

Thank you!

3 Replies 3

Greg-DB
Dropbox Staff

If the file is a PDF to begin with, you can use filesDownload to retrieve the original file data.

Exactly what you do with the data is up to you. Downloading to the local filesystem is not required. You may want to pass the file data to some PDF viewer, for instance. 

splnlss
Explorer | Level 3

I can retrieve the file but I can't load it into a pdf viewer using javascript. The pdf previewer is a small thumbnail that isn't useful.

How would one do this without first saving it to a server or saving it locally? I've tried react-pdf and other libraries but they can't render a blob.

For privacy reasons I don't want to render users files on a server, I just would like them to be able to view them in a JS webapp.

Thanks!

Greg-DB
Dropbox Staff

It sounds like you're able to retrieve the file data from the Dropbox API, and are now trying to use that file data client-side. The download-style methods, such filesDownload, yield a file blob of the file data. What you do with that is up to you.

Unfortunately, I'm afraid I can't recommend or endorse any particular third party library for displaying data like this, nor can I offer support for any third party method or code. You may be better served by the support community or documentation for any third party library you're trying to use, or a general web development forum.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    splnlss Explorer | Level 3
What do Dropbox user levels mean?