Hide specific macros in PDF export

Christian Czaia _Decadis AG_
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.
January 25, 2012

Hi there,

I'd like to hide specific macros, like the attachment macro, when I export a page or a space to PDF. Is there an easy solution or do I have to use the "NoPrint" workaround (create a user macro and define custome CSS) described here:

http://confluence.atlassian.com/display/DOC/NoPrint+Example+of+a+User+Macro

http://confluence.atlassian.com/display/DOC/Advanced+PDF+Export+Customisations#AdvancedPDFExportCustomisations-noprint

Thank you,

Christian

2 answers

1 accepted

1 vote
Answer accepted
BenA
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.
February 15, 2012

All the noprint macro does is set up a container with the "noprint" class on it.

You should be able to use the same technique in your PDF stylesheet by applying display:none to whatever selector you want, eg:

.plugin_attachments_container { display: none; }

That way you don't need to set up the noprint macro. It does mean you will not see the attachments macro in any PDF export, that is you don't have the fine-grained control offered by using the macro. So use the technique with caution :)

vprudnikov March 21, 2013

What is "PDF Stylesheed", how can I define them?

vprudnikov March 21, 2013

Sorry, found it.

0 votes
Doug Schwartz October 15, 2012

Any idea how to find selectors? I've posted this question as https://answers.atlassian.com/questions/96581/how-do-i-find-the-selector-for-a-plugin.

doug

Suggest an answer

Log in or Sign up to answer