It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Confluence Option to View PDF instead of download

Currently when we click on a pdf link in Confluence/Wiki the PDF gets downloaded. Is there an option to Open directly or view directly? Is it a security issue? Other websites have this option. Can we change Confluence link behavior?

If not, is there a Adobe macro to view instead of download?

Also is it possible to have a dynamic anouncement section on the main dashboard?

we do not want to update the Dashboard page but want announcements viewable in a corner similar to the Activity Macro

5 answers

1 accepted

1 vote
Answer accepted

In e.g. Firefox it is in the menu: Tools > Options > Application
There you search for the right "Content Type" and choose the appropriate "Action".

0 votes
Timothy Chin Community Leader Jun 17, 2013

Currently when we click on a pdf link in Confluence/Wiki the PDF gets downloaded

How a PDF gets viewed is usually determined by the browser.

I am upgrading confluence from 5.1 to 5.6.5. On 5.1 version, clicking link to attached PDF file while show the file in browser, but on 5.6.5 it trigger download (test on same browsers, Safari/Firefox/Chrome, on Firefox, for PDF it is set to 'Preview in Firefox')

Check with curl, it show the HTTP header for new version has 'X-Content-Type-Options: no sniff'. Is this the cause? any way to fix/workaround it?

Both HTTP headers have: Content-Type: text/html;charset=UTF-8, which seems wrong.

The content type of attachment is application/pdf on both server. 

Please try this option I just developed.

Confluence has a pdf preview function which we can access via an iframe.

Here is how:

1. In edit add the pdf file to the page using ctrl + m.

2. Choose the pdf if already attached or upload a new pdf now.

3. Save the page.

4. On the viewing page you will see the pdf as a thumbnail embedded on the page. 

5. Click the pdf thumbnail and the advanced pdf viewer will load.

6. Copy the url of the viewer

7. Edit the page again. Back in the edit screen delete the thumbnail and instead create an html macro and paste the following iframe code in with your url from step 6 replacing ENTER THE URL IN HERE with your url (leave the apostrophes)

<style>.embed-container { position: relative; padding-bottom: 100%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src=' ENTER THE URL IN HERE' style='border:0'></iframe></div>

8. Click save

You will now have a fully functioning viewer with download and even pdf edit options.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence Cloud

What's New in Confluence Cloud – October 2019 Edition

Hey there! When you can pack so much information onto a Confluence page, it can be challenging to whittle down what’s most important. Here are a few of our favorite hacks for finding need-to-know i...

53,130 views 53 134
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you