Confluence Option to View PDF instead of download

KP11
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 17, 2013

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
Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 17, 2013

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
Richard Isaacs
Contributor
September 18, 2019

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.

0 votes
Andrei [errno]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2015
0 votes
HCP Ops
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2014

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. 

0 votes
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events