3

I have a link to pdf file that located in the my Dropbox folder. For example: https://dl.dropboxusercontent.com/1/view/gqo4etwy7nudtu2/JasperReports-Server-Visualize.js-Guide.pdf

By clicking on the link, I may download the file. I want to embed the file on my site. I use the following code:

<iframe src="https://dl.dropboxusercontent.com/1/view/gqo4etwy7nudtu2/JasperReports-Server-Visualize.js-Guide.pdf?preview" height="100%" width="100%">
This browser does not support PDFs. Please download the PDF to view it: <a href="https://dl.dropboxusercontent.com/1/view/gqo4etwy7nudtu2/JasperReports-Server-Visualize.js-Guide.pdf?preview">Download PDF</a>
</iframe>

I tried to set two files, the link above and another one that I found on Google. The link above unable to embed, and it's opened for download, all the other files embedded successfully.

How can I embed pdf file from Dropbox?

5
  • 1
    This kind of link won't allow embedding because the Content-Disposition is attachment.
    – Greg
    Commented Dec 13, 2016 at 18:19
  • @Greg can I change that ?
    – ram
    Commented Dec 13, 2016 at 19:20
  • No, that's controlled by the server, and Dropbox doesn't offer a way to configure it.
    – Greg
    Commented Dec 13, 2016 at 20:59
  • @Greg Any other solution?
    – ram
    Commented Dec 13, 2016 at 21:45
  • [Cross-linking for reference: stackoverflow.com/questions/41123648/… ]
    – Greg
    Commented Dec 14, 2016 at 19:28

1 Answer 1

0

Found the Dropbox Embedder but not yet tested:

You need to create an account in the App Console and create an app to get the app key:

<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="YOUR_APP_KEY"></script>

Then you embed a Dropbox PDF file with the anchor tag:

<a
  href="https://www.dropbox.com/s/u0bdwmkjmqld9l2/dbx-supporting-distributed-work.pdf?dl=0"
  class="dropbox-embed"
  data-height="300px"
  data-width="600px"
></a>

More info here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.