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

Can i add a "Download as PDF" button to my page?

Dear all,

 

I wonder if there is a way to add a "Download PDF" button to the page. and this button should be able to download the page content and the children pages' content if there is any.

Thanks in advance,

naime

2 answers

Hi Naime,

you can create a user macro with that content:

## Macro title: exportpdf

## @noparams

<a href="<your confluence url>/spaces/flyingpdf/pdfpageexport.action?pageId=$content.getIdAsString()">print</a>

This macro genereates a link "print" that calls the export-pdf-function for this particular page. 

Exporting the children also is difficult. For that, I would use the export function in the space administration. 

For exporting content with Children Pages I recommend Content Exporter for Confluence addon: https://metainf.atlassian.net/wiki/spaces/CEX/pages/53968898/Export+Confluence+pages#ExportConfluencepages-Exportmultiplepages

It has much more flexible export functionalities than the built-in PDF export and it's still easy to use.

@Thomas_Schlegel I really like your Macro suggestion, thanks for that! Hope you don't mind I improved it a bit, which I would like to share:

## Macro title: Download as PDF button
## @noparams
<input type="button" onclick="location.href='$config.getBaseUrl()/spaces/flyingpdf/pdfpageexport.action?pageId=$content.getIdAsString()';" class="aui-button aui-button-primary" value="Download as PDF" style="display: inline;" />
 

So it now uses the base URL instead of a hardcoded URL and it displays as a button styled according to Confluence's colour scheme.

Like # people like this
Thomas_Schlegel Community Leader Oct 10, 2019

Thank you @Rick_van_Twillert__TMC_  - great improvement!

Hi Naime, 

Had you considered using an app to achieve what you are wanting? If not but you are interested, Scroll PDF Exporter would be able to implement what you require. 

With our app, you are able to style how you export your Confluence content through customizable templates. In addition, you can also define the specific export scope like you need. This means that you can choose to simply export a whole space, a single page or a page and its children.  Furthermore, you can also use Confluence page labels during the export process to further define which pages should be included and/or excluded from the export. 

These preferences can then be added to the Scroll Export Button macro, which is included when you install the app, on your Confluence page. This makes it easy to export your content using your specific customized template and export scope. 

If you are interested in these features or want to learn more about this app, you can do so on the Atlassian Marketplace – you can also start a trial for free. 

Feel free to reach out us if you have any further questions. 

Thanks, Thomas (K15t Software)

Suggest an answer

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

How is your team having fun and bonding, remotely, utilizing Confluence?

Thanks everyone for answering last week’s question. The winner of the random drawing from those who commented is: @LarryBrock I’ll contact you separately with your prize details. This wee...

294 views 9 7
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