cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

Is there a difference between PDF preview (endpoint : files/get_preview) and PDF files by /download

Is there a difference between PDF preview (endpoint : files/get_preview) and PDF files by /download

Mhd
Explorer | Level 4

Hello,

I am trying to display a doc file through /get_preview end point. 
My understanding is that it will generated a pdf preview (I guess that means a pdf file ? )

The pdf preview I am getting is generating an empty file. 
However, I test the same code generating the file  with the response from /download endpoint downloading a pdf file. the generated file is not empty. 

So, can I treat pdf_preview from /get_preview and pdf data from /download in the same way ? 
Or am I missing something here? 

Thank you 

1 Reply 1

Greg-DB
Dropbox Staff

The /2/files/download endpoint just returns the original file data. If the file is a PDF file, it will return the original PDF data.

 

The /2/files/get_preview endpoint generates a preview of the requested file, and does not return the original data. Per the documentation, it will generate either a preview in PDF or HTML format, depending on the type of the original file. Note that this endpoint does not support retrieving previews of PDF files.

 

If the file is already a PDF, you can just use the /2/files/download endpoint. If you do call the /2/files/get_preview endpoint for a .pdf file, it will fail with a 'unsupported_extension' error, which is likely the "empty" response you're referring to.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?