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

Exclude Content from PDF Export

Simon Nimführ August 7, 2019

In older versions, there was a noprint macro that you could use to exclude content that you didn't want to be included in a PDF export.

How do we do this in the current Confluence version?

3 answers

1 accepted

6 votes
Answer accepted
Nicolai Sibler
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.
August 21, 2019

The fabulous @Thomas Schlegel once posted a user macro for this:

This macro should have a rendered body and the following Template:

## @noparams
<div class="NoPrint">$body</div>

Add the following to the PDF Stylesheet:

.NoPrint { display: none ; }

Put the content to be hidden in the body of the macro.

Thomas Schlegel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 21, 2019

:-)

Like # people like this
Stephanie Grice
Community Manager
Community Managers are Atlassian Team members who specifically run and moderate Atlassian communities. Feel free to say hello!
August 21, 2019

@Thomas Schlegel is fabulous, it's true! :) 

Like # people like this
2 votes
Simon Nimführ August 29, 2019

@Thomas Schlegel 

Which macro comes from you or where do I have to insert this code into Confluence? Is there a manual?

Thomas Schlegel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 29, 2019

Hi @Simon Nimführ , 

as an administrator of Confluence, you can create user macros on your own (not for cloud instances, only for server).

I described creating user macros in an article some time ago:

https://community.atlassian.com/t5/Confluence-articles/The-Admin-s-tale-User-Macro-filtering-a-Confluence-table/ba-p/459369

It's another use case, but you can find the basics of creating a user macro there.

If you have more questions, don't hesitate to ask. 

Like Florian Loikasek likes this
shilpa shilpa October 9, 2020

Hello,

I used "NoPrint" macro to hide content from confluence page. It works fine when I try to hide certain sentences, but, when I try to hide the entire section, the PDF that gets generated hides the content, but, in the ToC, the section title is added with page number marked as 0. This looks very weird. Is there a fix for this? I do not need the section title that is marked to be hidden to show up in ToC. Thanks.

Like Josh Simnitt likes this
0 votes
Meera_Amanullah May 11, 2023

Hi @Thomas Schlegel

I'm using  confluence data center version 7.13.7. Can I use the no print macro? please confirm. Also, I have the administrator rights, but Im not sure whewre to create the macro, as you have mentioned in the below page. https://community.atlassian.com/t5/Confluence-articles/The-Admin-s-tale-User-Macro-filtering-a-Confluence-table/ba-p/459369

 

Thank you

Nicolai Sibler
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.
May 11, 2023
Meera_Amanullah May 11, 2023

Hi

Im not able to find General Configuration, in my Confluence interface. Im using confluence data center version 7.13.7, can you please confirm, the steps mentioned in the below link is applicable to my version.

https://confluence.atlassian.com/conf713/writing-user-macros-1077914347.html

 Thank you

Nicolai Sibler
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.
May 11, 2023

When you see the cog in the top right corner between the question mark and the bell, click it and choose the first option.

grafik.png
If you don't see the cog, you are not a Confluence Admin. Only Confluence admins can set up user macros. Contact yours in this case.

Meera_Amanullah May 11, 2023

Thanks for the input. I found the administrator and got the macro created.

Could you please let me know, if there is any specific location where I need to place the text ".NoPrint { display: none ; }" on the stylesheet.

Thank you

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events