Exclude Content from PDF Export
Asked by Simon Nimf?hr:

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?


Answers:
author: Nicolai Sibler
body: The fabulous [@Thomas Schlegel](/t5/user/viewprofilepage/user-id/781483) 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.

comments: author: Thomas Schlegel
body: :-)


author: Stephanie Grice
body: [@Thomas Schlegel](/t5/user/viewprofilepage/user-id/781483) **is**fabulous, it's true! :)


author: Simon Nimf?hr
body: [@Thomas Schlegel](/t5/user/viewprofilepage/user-id/781483)

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

comments: author: Thomas Schlegel
body: Hi [@Simon Nimf?hr](/t5/user/viewprofilepage/user-id/3518946) ,

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.


author: shilpa shilpa
body: 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.


author: Meera.Amanullah
body: Hi [@Thomas Schlegel](/t5/user/viewprofilepage/user-id/781483)

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

comments: author: Nicolai Sibler
body: Hi [@Meera.Amanullah](/t5/user/viewprofilepage/user-id/5198768) ,

please check Atlassians documentation: <https://confluence.atlassian.com/conf713/writing-user-macros-1077914347.html>


author: Meera.Amanullah
body: 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


author: Nicolai Sibler
body: 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](https://community.atlassian.com/t5/image/serverpage/image-id/256630i2C6308752BAEB1B0/image-size/large?v=v2&px=999 "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.


author: Meera.Amanullah
body: 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


Tags: confluence-server

server