Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

How to embed a pdf file to a page?

Is there a way to embed a pdf file to a page so I can scroll through it without having to open it?

3 answers

0 votes

Hi Anthony,

You will currently be able to use the PDF Macro to embed PDF files within a page and view them.

Please be advised this will be removed in future releases.

Let us know if you have any questions!

Kind Regards,

Shannon

Why does the macro still exist but not let me use it?

Hello Topher,

Welcome to Atlassian Community! Thank you for contacting us.

You should still be able to use the PDF Macro at this time. If you are having any issues with it, please elaborate on that so we can help you to solve your issue.

I wanted to let you know more about why I told Anthony that the macro would eventually be deprecated.

The PDF Macro is part of the View File Macro, which is the macro in Confluence Server that allows users to preview file attachments within Confluence.

We had previously made a decision to deprecate that macro (see CONFSERVER-39829 Plans to remove the view file macros).

However, as of 22 January 2019, we reversed that decision:

End of Support Announcements for Confluence

Update 22 January 2019
We know from your feedback that the existing View File macros provide important functionality that the newer file upload and preview experience does not. For this reason, we've decided to reverse the decision to stop supporting these macros

This means from Confluence 6.14, we will fix bugs relating to these macros, and will not remove the macros from Confluence. 

I hope that clarifies things, but if you are still having an issue with it, I'd love to know more about it so I can help you out.

Regards,

Shannon

Like adickey likes this

Hello Shannon,

We are using cloud version of Confluence and the problem we are facing is as below. We have uploaded some pdf documents on a single confluence page (say page 'Repo'). We then have other pages where we want to display selected pdf documents  from the Repo page. We tried using the pdf macro and gave reference to Repo page. It lists the available pdf documents but we cannot Save this to make these documents available on the target pages.

Business case is we store results (as pdf) of testing performed for our releases on Repo page. We have separate pages for each release where we want to reference to the appropriate result pdf. 

Have you tried my solution above? If you use steps 1 to 5 it will embed a pdf icon on the page. You should be able to embed a pdf from any page using more or less this process.

Like Shannon Spaniol likes this

Hi Meghandand,

Thank you for getting in touch. You can try Richard's suggestion, and if you have any trouble, I would recommend either raising a new question, or creating a support ticket if you have a support license.

The reason being is that the original question here is a lot older, so the rest of the Community might not see that you're struggling. By raising a new question more of us can help you out. :) 

Regards,

Shannon

Thank you for your responses Richard and Shannon. @Richard Isaacs I did try out your suggestion but I somehow don't get the URL specific to the PDF from your step 6 above. Hence when I provide that URL to the iframe macro the entire confluence page hosting the PDF gets displayed. Maybe I am doing something silly. I would create a new thread as suggested by Shannon.

 

Regards,

Meghanand

Like Shannon Spaniol likes this

Hi Meghanand. Are you opening the pdf by clicking the thumbnail? When you do that you should get the pdf loaded in a viewer with a black frame. The url should look something like this https://yoursite.com.au/display/area/titleofdocument.pdf 

When I insert the PDF, save, then click the thumbnail, the URL does not change.  It's the same as the host page. 

(EDIT) Nevermind, I got it to work using the Macro

Hi everybody, thanks for the feedback. I have found the issue, it is a difference in browser setups. I have adjusted the instructions now so it should work on all browsers. See the instructions below.

UPDATED! THE BELOW PROCESS HAS BEEN UPDATED (STEP 6) FOLLOWING FEEDBACK AND ISSUES USING DIFFERING BROWSERS.

Hi I thought I would share this option with you that I just found. It is not perfect really just embedding another type of viewer but I think it is better.

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. Click the share icon in the viewer bar and then copy the share link.

shot.jpg

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.

UPDATED! THE BELOW PROCESS HAS BEEN UPDATED (STEP 6) FOLLOWING FEEDBACK AND ISSUES USING DIFFERING BROWSERS.

Hi I thought I would share this option with you that I just found. It is not perfect really just embedding another type of viewer but I think it is better.

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. Click the share icon in the viewer bar and then copy the share link.shot.jpg
  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.

I don't seem to have a html macro .

Did you install seperately?

 

Edit: Nevermind, I found the solution.

Thanks!

https://confluence.atlassian.com/doc/html-macro-38273085.html

Like Shannon Spaniol likes this

Hi,

'Insert PDF Macro' doesn't work. 'Insert' button is disabled. screenshot attached.

Confluence-add-pdf.jpg

Mine is Version 86.0.4240.111 (Official Build) (64-bit) . 

From the new instructions the step 1 does not work for me.

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

Hi

The macro seems to indicate it is not finding any appropriate pdfs attached to the page. To fix this, an alternative is view the original page out of edit mode and then drag and drop the pdf onto the page, it will upload as an attachment. Then you should be able to find it in edit mode in the pdf macro.

The Page Name is the name of the confluence page where it is looking for the PDF file. You should leave it blank if you just uploaded it to this page.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

408 views 23 8
Join discussion

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