Hide content in screen but not in PDF export

Hi all,

I used to play with the noPrint feature to hide content from PDF exports with no problems.
But how do I hide the content in the page but show it in the pdf export?

I have tried with inline style for the divs (display:none or visibility:hidden) in the confluence page and custom CSS for pdf export overwritting these but the inline style is not overwritten. This end up with hidden content in both screen and PDF...

Any idea?

PS: I would use this for runningheader and runningfooter being defined in the page but that I want to hide in the confluence page (keep it for the edit mode only)

2 answers

Hello Plet Benoit,

we faced the same issue some time ago.

You migth use the "show-if" makro from https://marketplace.atlassian.com/plugins/net.customware.confluence.plugin.visibility as a conditional branch within your own macro. 

e.g.:

## @noparams

<ac:macro ac:name="show-if">
	<ac:parameter ac:name="display">pdf</ac:parameter>
	<ac:rich-text-body>
		... your html ...		
	</ac:rich-text-body>
</ac:macro>

My requirement is to hide some content (for example JIRA macros that are only shown as loooong URLs) from PDF export. But similar to Benoit Plet findings, one can change some attributes like background color of the element, but display: none; has no effect.

Could this be considered a bug or limitation in PDF export?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published 12 hours ago in Confluence

Think you know shares vs. @mentions in Confluence? Take this collab quiz.

To anyone who doubts that Atlassians are a little too obsessed with collaboration, and tools related thereto, let me describe a recent discussion we had (which took place on our internal Confluence, ...

95 views 2 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you