One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
Mhd
8 years agoExplorer | Level 4
Is there a difference between PDF preview (endpoint : files/get_preview) and PDF files by /download
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
- 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.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 18 hours ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!